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

Switch to pyproject.toml #80

Merged
merged 13 commits into from
Nov 7, 2024
Merged

Switch to pyproject.toml #80

merged 13 commits into from
Nov 7, 2024

Conversation

thecharlieblake
Copy link
Contributor

@thecharlieblake thecharlieblake commented Nov 6, 2024

We're now on PyPI! https://pypi.org/project/unit-scaling/

Some things I've changed to make this work (working from the stuff Paul did in jax-scalify):

  • Moved from setup.py to pyproject.toml and put in various info there that PyPI needs
  • There's now no requirements.txt; everything is in pyproject.toml which you get via pip install -e . (developers can still pip install -r requirements-dev.txt)
  • Versioning is now automatic (via setuptools-scm). The way this works is that to increment the version you're expected to tag a commit with the version number and then create a github release based on this tag. This should trigger the new CI action which publishes to PyPI.
  • For dev/testing purposes I had to create a couple of dummy releases on this branch (which are what's currently on PyPI). When we merge this PR we should create a new tag & release, and possibly disable releases from branches in future.

This should be all the changes for now. With these fixes made it should hopefully be very easy for us to develop and publish future features to the library.

@thecharlieblake thecharlieblake self-assigned this Nov 6, 2024
Copy link
Collaborator

@DouglasOrr DouglasOrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very nice! I may steal much of it for pytorch-tensor-tracker sometime soon!

@@ -31,7 +31,7 @@ ENV PATH="$PATH:/home/$USERNAME/.local/bin" \

# Install Python dependencies
COPY requirements-dev.txt .
RUN pip install -r requirements-dev.txt
RUN pip install --user -r requirements-dev.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why install --user in a Dockerfile - I usually assume everything can go system-wide within the image..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At one point I was having some nasty ownership issues so I shifted to this, though I'm not sure if this was actually the fix in the end. Docker ownership stuff scares me, so this does make me feel a little safer even if it's not necessary 🤷 unless you think this could cause issues...

[options]
packages =
unit_scaling

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess most of this file could go into pyproject.toml, but perhaps still not flake8.

That said, unless you can delete this file entirely, I don't see much benefit in moving.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was my thinking entirely - looking at Paul's stuff it seemed like he could move everything except flake8, which made me not bother. Though switching to better tools should fix this 🙃

@thecharlieblake thecharlieblake merged commit f5b5aad into main Nov 7, 2024
1 check passed
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.

2 participants