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

Convert setup.py to setup.cfg #77

Merged
merged 2 commits into from
Feb 1, 2022
Merged

Conversation

mwtoews
Copy link
Contributor

@mwtoews mwtoews commented Jan 30, 2022

Refer to setuptools' declarative configuration page for moving the static metadata into setup.cfg. The long description was modified to use README.md, which means that the PyPI page will show the same help as GitHub. All other metadata remains the same, so it's a close 1:1 conversion.

To build and upload:

$ pip install --upgrade build twine
...
$ python -m build
...
Successfully built gprof2dot-2022.1.31.tar.gz and gprof2dot-2022.1.31-py3-none-any.whl
$ twine upload --repository testpypi dist/*
...

View at:
https://test.pypi.org/project/gprof2dot/2022.1.31/

A few other notes:

  • Now setup.py is a simple wrapper, which some folks expect to see; it may go away someday
  • MANIFEST.in was removed, as the files were included anyways

@jrfonseca
Copy link
Owner

I didn't know about PEP 517. Change looks great as far as I can tell. Thanks for doing this.

@mwtoews
Copy link
Contributor Author

mwtoews commented Feb 1, 2022

I just noticed that this runs for Python 2.7, so I've amended to add [bdist_wheel] universal=1 to build the *-py2.py3-none-any.whl file instead of *-py3-none-any.whl. Also, I've removed the older Python 3.4 and 3.5 classifiers as just "Python 3" should be fine and does not need to be maintained/updated.

Another idea (which can be done in this PR) is to move the version to gprof2dot.py (as __version__), then it can be dynamically discovered with version = attr: gprof2dot.__version__. This way the version would be available in the main script too (if that's important).

@jrfonseca jrfonseca merged commit 2245ac5 into jrfonseca:master Feb 1, 2022
@mwtoews mwtoews deleted the setup-cfg branch February 1, 2022 09:40
@jrfonseca
Copy link
Owner

Another idea (which can be done in this PR) is to move the version to gprof2dot.py (as __version__), then it can be dynamically discovered with version = attr: gprof2dot.__version__. This way the version would be available in the main script too (if that's important).

Thanks. It's a thought, but I believe it's fine to omit the version on the script itself for now.

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.

None yet

2 participants