Skip to content

project/package structure obfuscates MANIFEST.in errors #90

@KonradUdoHannes

Description

@KonradUdoHannes
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions