Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move project sources to src/ subdir #12

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

nitzmahone
Copy link
Member

  • src/ layout is de-facto standard these days
  • the presence of parts of the main cffi package in the project root can mask packaging problems, even when we're testing against an installed wheel (eg, missing files/subpackages)

* MANIFEST.in, the source layout, and pytest's default sys.path behavior conspired to mask a busted package, even though we were testing against the built package. `pytest` adds cwd to the path first, and since the `cffi` is in the root (grr), even though we're testing against the installed wheel, pytest loaded the subpackage from the source, masking that it was missing from the actual package (due to flat inclusions in MANIFEST.in). This is a longer-term problem that should be addressed by moving to a standard `src/` layout, and possibly also by bringing `_cffi_backend` in as a subpackage, but there are likely many dragons there with wheels that assume the presence of the top-level package.
* allows testing against packaged wheels to catch missing files (since pytest always prepends cwd to sys.path)
@nitzmahone nitzmahone merged commit 932eba2 into python-cffi:main Sep 26, 2023
nitzmahone added a commit to nitzmahone/cffi that referenced this pull request Sep 26, 2023
* move the distutils shim module back to a plain module

* MANIFEST.in, the source layout, and pytest's default sys.path behavior conspired to mask a busted package, even though we were testing against the built package. `pytest` adds cwd to the path first, and since the `cffi` is in the root (grr), even though we're testing against the installed wheel, pytest loaded the subpackage from the source, masking that it was missing from the actual package (due to flat inclusions in MANIFEST.in). This is a longer-term problem that should be addressed by moving to a standard `src/` layout, and possibly also by bringing `_cffi_backend` in as a subpackage, but there are likely many dragons there with wheels that assume the presence of the top-level package.

* move project sources under src/

(cherry picked from commit 932eba2)
@nitzmahone nitzmahone deleted the to_src_subdir branch September 26, 2023 05:13
nitzmahone added a commit that referenced this pull request Sep 26, 2023
* move project sources to `src/` subdir (#12)

* move the distutils shim module back to a plain module

* MANIFEST.in, the source layout, and pytest's default sys.path behavior conspired to mask a busted package, even though we were testing against the built package. `pytest` adds cwd to the path first, and since the `cffi` is in the root (grr), even though we're testing against the installed wheel, pytest loaded the subpackage from the source, masking that it was missing from the actual package (due to flat inclusions in MANIFEST.in). This is a longer-term problem that should be addressed by moving to a standard `src/` layout, and possibly also by bringing `_cffi_backend` in as a subpackage, but there are likely many dragons there with wheels that assume the presence of the top-level package.

* move project sources under src/

(cherry picked from commit 932eba2)

* release 1.16.0rc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant