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

Ready this for publication to the Python Package Index #5

Merged
merged 1 commit into from
Aug 23, 2024
Merged

Ready this for publication to the Python Package Index #5

merged 1 commit into from
Aug 23, 2024

Conversation

nutjob4life
Copy link
Contributor

Purpose

Makes this repository ready for publication to the Python Package Index so end-users can simply pip install it without checking out the code, without managing dependencies, etc. All they need is a working Python.

Proposed Changes

  • Makes a new console script available: slim
  • Removes requirements.txt and replaces it with pyproject.toml which has both the dependencies and the package metadata
  • Updates the README instructions to demonstrate installation from PyPI as well as how to continue local development
  • Adds support for --version and version tracking
  • Adds a .gitignore
  • Removes potential Dependency Confusion Vulnerabilities
  • Comments-out tabulate dependency; it doesn't appear to be used
  • Removes argparse dependency; it's part of the standard library

Issues

N/A.

Testing

bash-3.2$ python3 -m venv .venv
bash-3.2$ . .venv/bin/activate
(.venv) bash-3.2$ pip install --quiet --editable .

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
(.venv) bash-3.2$ which slim
/private/tmp/slim-cli/.venv/bin/slim
(.venv) bash-3.2$ slim --version
0.0.0

Notes

This doesn't actually publish SLIM CLI to PyPI. I'll leave it to the repository owners to do that so they can grab the name before someone else does (including me).

To do so (assuming your ~/.pypirc is set up):

bash-3.2$ python3 -m venv .venv
bash-3.2$ . .venv/bin/activate
(.venv) bash-3.2$ pip install --quiet build wheel twine

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
(.venv) bash-3.2$ python3 -m build .
…
(.venv) bash-3.2$ twine upload dist/*
…

- Makes a new console script available: `slim`
- Removes `requirements.txt` and replaces it with `pyproject.toml` which has both the dependencies and the package metadata
- Updates the instructions to demonstration installation from PyPI as well as how to continue local development
- Adds support for `--version` and version tracking
- Adds a `.gitignore`
- Removes potential [Dependency Confusion Vulnerabilities](https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610)
- Comments-out `tabulate` dependency; it doesn't appear to be used
- Removes `argparse` dependency; it's part of the standard library
@yunks128
Copy link
Contributor

@nutjob4life Thank you for your contribution!
It's published:
https://pypi.org/project/slim-cli/

@yunks128 yunks128 merged commit 9f224a1 into NASA-AMMOS:main Aug 23, 2024
@nutjob4life
Copy link
Contributor Author

nutjob4life commented Aug 23, 2024

@yunks128 awesome! And thanks for moving so quickly on this! 🎉

The next thing you might want to do is add more "owners" to PyPI so that not just you can publish it, but your other SLIM compatriots can also do it. You never want "SOLE OWNER" to appear on your list of projects—after all, if something terrible were to happen to you, no one else could ever update this package! 😱

For example, on my own "Projects" page, I see I need to fix that for at least one of my own projects:
Screenshot 2024-08-23 at 8 12 39 AM

@nutjob4life nutjob4life deleted the cheeseshop branch August 23, 2024 13:10
@yunks128
Copy link
Contributor

Thank you @nutjob4life ! I invite you and @riverma as collaborators! I appreciate your help!

@riverma
Copy link
Collaborator

riverma commented Aug 24, 2024

@nutjob4life - just tested out your GREAT improvements to the organization, user experience, and setup process for slim-cli. Absolutely wonderful. Thank you so much for your most excellent contributions! The branch is even deliciously named cheeseshop!

I love how I can run the tool as simply now like:

slim list

Brilliant contribution and thank you!

@nutjob4life
Copy link
Contributor Author

Aww, I appreciate that (and for noticing my branch name 😉) but seriously @yunks128 deserves the lion's share of the credit! Thank you KS! 🎉 🎸

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.

3 participants