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

setup.py -> pyproject.toml, and mv tap to src #142

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

kddubey
Copy link
Contributor

@kddubey kddubey commented Jul 1, 2024

The goal of this PR is to make tap's structure a bit safer. Here are the changes:

  1. Replace setup.py w/ a static pyproject.toml. See docs
  2. Move tap to src/tap. See docs
  3. 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
  1. Make and activate a fresh venv (I use virtualenvwrapper)

    mkvirtualenv temp
    
  2. Uninstall wheel, setuptools

    python -m pip uninstall wheel setuptools --upgrade pip
    
  3. Install the package from the fork

    python -m pip install git+https://github.com/kddubey/typed-argument-parser.git@pyprojecttoml
    
  4. Install pytest and pydantic, and run pytest

    python -m pip install pytest "pydantic>=2"
    
    pytest
    
  5. rm temp

    rmvirtualenv temp
    
Build, test-upload, install, and test the package
  1. Checkout this branch:

    git pull
    
    git checkout pyprojecttoml
    
  2. Make and activate a fresh venv (I use virtualenvwrapper)

    mkvirtualenv temp
    
  3. Install some packaging things

    python -m pip install build twine
    
  4. Build the package

    python -m build
    

    dist/ should have:

    typed_argument_parser-1.10.0-py3-none-any.whl
    typed_argument_parser-1.10.0.tar.gz
    
  5. Test the contents of dist/

    python -m twine check dist/*
    
  6. 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

  7. 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
    
  8. Install pytest and pydantic, and run pytest

    python -m pip install pytest "pydantic>=2"
    
    pytest
    
  9. Maybe run some of the demo scripts in the repo in case you wanna double check

  10. rm temp

rmvirtualenv temp

pyproject.toml Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.07%. Comparing base (b6505ff) to head (9f90ea1).

❗ 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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martinjm97 martinjm97 merged commit af4b7db into swansonk14:main Jul 7, 2024
16 of 17 checks passed
@kddubey kddubey deleted the pyprojecttoml branch July 7, 2024 18:50
@martinjm97
Copy link
Collaborator

Great work as always @kddubey! Thank you!

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

Successfully merging this pull request may close these issues.

Warning during installation when wheel isn't installed
3 participants