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

project/package structure obfuscates MANIFEST.in errors #90

Open
KonradUdoHannes opened this issue May 30, 2020 · 0 comments
Open

project/package structure obfuscates MANIFEST.in errors #90

KonradUdoHannes opened this issue May 30, 2020 · 0 comments

Comments

@KonradUdoHannes
Copy link
Collaborator

  • Datenguide Python version: 0.2.2
  • Python version: all
  • Operating System: all

Description

Currently MANIFEST.in errors are not caught by tox or similarly travis-ci. The reason is an interplay of these tools, pytest and the package/project structure. The testing tools create an sdist of the package and install it. This installation however is shadowed by the copy of the modules present in the project folder itself. This happens as pytest dynamically adds paths to sy.path in order to execute its test cases.

As a consequence tests are run on the project folder modules instead of the packaged and installed ones. Errors in packaging due to wrong or missing entries in the MANIFEST.in are hence not uncovered.

Branch for restructuring

In order to address this issue the project should be restructured involving folder and file placement and setup.py configuration. To check the success of the restructuring easily a branch called package_structure_issue was created containing an additional test case. This test case checks for the absence of a file inside the query_builder module folder. The file was created inside the project folder but not added to the MANIFEST.in
Therefore a after a successful restructuring the test should run on the sdist module where the file is absent (and hence pass)

A possible project structure that could work would involve an extra parent directory for the packge source:

Current
datenguidepy
|---- datenguidepy #package module
|---- tests

Running the tests adds tests parent to sys.path -> and hence the package module of the project is found

Possible Solution
datenguidepy
|----src
|---- datenguidepy #package module
|---- tests

The main folder still gets added to sys.path, but the package module is not found

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

No branches or pull requests

1 participant