-
Notifications
You must be signed in to change notification settings - Fork 16
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
(Not) Exclude tests
from source distribution, and drop python2 tag for wheel
#202
Conversation
MANIFEST.in
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any way to do this without a MANIFEST.in
file? i try to minimize config files in the repo root directory, esp. if they just have a few lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least from pypa/setuptools#3260 (comment), the answer might be no:
If you want to modify the contents of the sdist (process A), you cannot do that via the pyproject.toml. Either you have to use MANIFEST.in or rely on the selection done by your plugin of choice (e.g. setuptools-scm).
Personally I prefer to avoid including additional config files whenever possible too. I would do some more research on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think if MANIFEST.in
is the only way to exclude them, i slightly prefer to leave the tests file in the source dist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong preference this time, mostly because the tests are pretty small in size and don't include any test file.
I might do some further research later, hoping I missed something here :) Looks like no way around this except for the below
Pin another related discussion on why tests are still included in sdist when exclude
tests in packages
: pypa/setuptools#3922 (comment)
There is some level of agreement in the community that believe it is a good practice to include test files into the sdists, that is why setuptools include them by default.
If you don't want to include files in the sdist, that is still possible, but the configuration that you need to change is the one in MANIFEST.in: https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html (not packages).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other workarounds I just thought of might be:
- rename
tests
(topmv_tests
for example), now that we have:Lines 70 to 71 in b551581
[tool.pytest.ini_options] testpaths = ["tests"] Files that match the following glob patterns: tests/test*.py, test/test*.py;
- move to the
src
layout
Frankly I like neither of them, just mention them.
49d8e7c
to
0c930f0
Compare
|
||
[tool.setuptools.package-data] | ||
pymatviz = ["*.csv"] | ||
|
||
[tool.distutils.bdist_wheel] | ||
universal = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tag might have been misused here:
If your project also supports Python 2 and contains no C extensions, then you should create what’s called a Universal Wheel by adding the following to your setup.cfg file:
[bdist_wheel]
universal=1
For our pure python code:
The wheel package will detect that the code is pure Python, and build a wheel that’s named such that it’s usable on any Python 3 installation. For details on the naming of wheel files, see PEP 425.
Now:
python3 -m build --wheel
>>> Successfully built pymatviz-0.11.0-py3-none-any.whl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to know! thanks for troubleshooting. 👍
i have that line in a bunch of my projects. sounds like i should remove it everywhere. could you remove it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep it has already been removed :)
tests
from source distributiontests
from source distribution, and drop python2 tag for wheel
* `element_pair_rdfs` plots radial distribution functions (RDFs) for element pairs in a structure (#203) * improve set_plotly_template auto-complete with Literal type * add element_pair_rdfs(structure) -> go.Figure in new pymatviz/rdf.py module * add tests/test_rdf.py * remove ase.Atoms conversion to avoid new pkg dep * show element_pair_rdfs examples in readme * should have used save_and_compress_svg * fix rds svg path --------- Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>
include = ["pymatviz*"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @DanielYang59! 👍 i'll go ahead and merge if you don't mind?
Sure thanks! |
tests
from source distribution, and drop python2 tag for wheeltests
from source distribution, and drop python2 tag for wheel
Summary
tests
from source distribution, to close Tests are included in source distribution? #201tests
were originally just in sdist, not bdist (see Confusion about the effects of settingpackages
forsdist
pypa/setuptools#3922)