neithere / argh

An argparse wrapper that doesn't make you say "argh" each time you deal with it.
http://argh.rtfd.org
GNU Lesser General Public License v3.0
369 stars 56 forks source link

chore: publishing to prod PyPI #173

Closed neithere closed 1 year ago

neithere commented 1 year ago

The builds do not include all the expected files. A further investigation is required.

neithere commented 1 year ago

The problem at the moment:

$ diff -r dist/compare-builds/ci/argh-0.28.1 dist/compare-builds/flit_local/argh-0.28.1
Only in dist/compare-builds/flit_local/argh-0.28.1: AUTHORS
Only in dist/compare-builds/flit_local/argh-0.28.1: CHANGES
Only in dist/compare-builds/flit_local/argh-0.28.1: COPYING
Only in dist/compare-builds/flit_local/argh-0.28.1: docs
Only in dist/compare-builds/flit_local/argh-0.28.1: .flake8
Only in dist/compare-builds/flit_local/argh-0.28.1: .github
Only in dist/compare-builds/flit_local/argh-0.28.1: .gitignore
Only in dist/compare-builds/flit_local/argh-0.28.1: Makefile
Only in dist/compare-builds/flit_local/argh-0.28.1: MANIFEST.in
Only in dist/compare-builds/flit_local/argh-0.28.1: .pre-commit-config.yaml
Only in dist/compare-builds/flit_local/argh-0.28.1: .readthedocs.yml
Only in dist/compare-builds/flit_local/argh-0.28.1: tests
Only in dist/compare-builds/flit_local/argh-0.28.1: tox.ini
Only in dist/compare-builds/flit_local/argh-0.28.1: .yamllint.yaml

The result of flit build includes docs, tests and other files (perhaps even too many) while the simple python -m build does not include them. It doesn't seem that MANIFEST.in affects any of those. An investigation is needed.

The pipeline doesn't push to prod PyPI anyway because the creds are not valid but it does push to Test PyPI and it's evident that the wheel is identical to Flit's but the sdist is much smaller.

neithere commented 1 year ago

Look like this in pyproject.toml should be enough for CD:

[tool.flit.dist]
include = ["tox.ini", ...etc... ]

For a full comparison:

python -m build --sdist -o dist/ . && tar list -f dist/argh-0.28.1.tar.gz
flit build && tar list -f dist/argh-0.28.1.tar.gz

Note that flit build can go pack itself if the normal way works well enough, so we don't need to make it respect the config.

neithere commented 1 year ago

I decided not to include the docs and some tool configs into sdist because I expect anyone needing these files (as files, not HTML @ RTD) to simply check out the repo.