typed-argument-parser
typed-argument-parser copied to clipboard
setup.py -> pyproject.toml, and mv tap to src
The goal of this PR is to make tap's structure a bit safer. Here are the changes:
- Replace
setup.pyw/ a staticpyproject.toml. See docs - Move
taptosrc/tap. See docs - Store
tap.__version__as a literal string
From the user's perspective, I believe there aren't any breaking changes. But in case you prefer making the most minimal change to fix #141, it would be to add a pyproject.toml which looks like this:
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
How has this been tested?
Install the fork
-
Make and activate a fresh venv (I use virtualenvwrapper)
mkvirtualenv temp -
Uninstall
wheel,setuptoolspython -m pip uninstall wheel setuptools --upgrade pip -
Install the package from the fork
python -m pip install git+https://github.com/kddubey/typed-argument-parser.git@pyprojecttoml -
Install
pytestandpydantic, and runpytestpython -m pip install pytest "pydantic>=2"pytest -
rm temp
rmvirtualenv temp
Build, test-upload, install, and test the package
-
Checkout this branch:
git pullgit checkout pyprojecttoml -
Make and activate a fresh venv (I use virtualenvwrapper)
mkvirtualenv temp -
Install some packaging things
python -m pip install build twine -
Build the package
python -m builddist/should have:typed_argument_parser-1.10.0-py3-none-any.whl typed_argument_parser-1.10.0.tar.gz -
Test the contents of
dist/python -m twine check dist/* -
Test that fake-uploading to PyPI works (I haven't actually ran this step onwards)
python -m twine upload --repository testpypi dist/*You may wanna also check that https://test.pypi.org/project/typed-argument-parser looks good
-
Test that installing from this test PyPI repo works
python -m pip install \ --index-url https://test.pypi.org/simple/ \ --extra-index-url https://pypi.org/simple/ \ typed-argument-parser -
Install
pytestandpydantic, and runpytestpython -m pip install pytest "pydantic>=2"pytest -
Maybe run some of the demo scripts in the repo in case you wanna double check
-
rm temp
rmvirtualenv temp
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.07%. Comparing base (
b6505ff) to head (9f90ea1).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #142 +/- ##
==========================================
- Coverage 94.10% 94.07% -0.03%
==========================================
Files 5 4 -1
Lines 695 692 -3
==========================================
- Hits 654 651 -3
Misses 41 41
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Great work as always @kddubey! Thank you!