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

chore: migrate to hatch + use hatchling for the build backend, drop Python 2 support #626

Merged
merged 12 commits into from
Aug 13, 2024

Conversation

agriyakhetarpal
Copy link
Collaborator

@agriyakhetarpal agriyakhetarpal commented Jul 30, 2024

Description

  • Stemmed off from Fix numpy v2 breaking changes #618 – the packaging infrastructure for autograd has been migrated to use hatchling.build instead of setuptools.build_meta as the build backend. Some missing metadata entries have been added in pyproject.toml.
  • Dependence on the six and future libraries has been removed, since all of the code is compatible with Python 3.
  • Python 2 support has been dropped and the wheels are tagged with py3 for the Python tag instead of py2-py3.
  • Lastly, I added some future TODOs so that I can keep track of them sometime soon.

What issue does this PR close/address?

Closes #606
Closes #513, since we won't need setuptools-specific files anymore.

Caveats (i.e., tasks for future PRs)

  • to enable VCS versioning via dynamic = ["version"] and the hatch-vcs plugin to derive the version from Git; and
  • to use hatch environment commands in place of tox through the addition of a [tool.hatch.run] table in pyproject.toml.

Additional notes

The conda.yaml file doesn't look like it's going to work anyway; I'll modify this in another PR and switch to an environment.yaml file if needed, or we can drop it sometime soon: all of our dependencies both for regular usage and development work are available via PyPI.

@agriyakhetarpal agriyakhetarpal requested a review from fjosw July 30, 2024 13:46
@agriyakhetarpal agriyakhetarpal changed the title chore: migrate to hatch + use hatchling for the build backend chore: migrate to hatch + use hatchling for the build backend, drop Python 2 support Jul 30, 2024
See #618 where this will be rebased to
@agriyakhetarpal
Copy link
Collaborator Author

agriyakhetarpal commented Jul 30, 2024

I'm hitting the same error as the other PR, which suggests that the problem is with either Hatch or PyPy-3.10-Windows – changing the build backend did not work. Either way, I'm sure these changes are beneficial. I guess it should be safe to drop this platform and test just PyPy-3.10-Ubuntu and PyPy-3.10-macOS. @fjosw, what do you think?

@agriyakhetarpal
Copy link
Collaborator Author

Similar error: actions/runner-images#5009 – I bumped setup-python to v5 and then to v5.1.1; that doesn't resolve it either. It could be a bug in PyPy itself since 322122547 means it's trying to access an invalid memory address.

@agriyakhetarpal
Copy link
Collaborator Author

Looking at the logs, the installation time for all platforms on PyPy is unusually high. It shouldn't take thirteen minutes just to install a pure Python project at all.

@fjosw
Copy link
Collaborator

fjosw commented Jul 30, 2024

Hey @agriyakhetarpal, I would be fine with not running PyPy tests on windows, or even dropping all PyPy tests if they cause so many troubles, whatever you prefer.

@agriyakhetarpal
Copy link
Collaborator Author

Sure, I dropped it for just Windows for now, since it's tested elsewhere and PyPy 3.9 is passing for Windows. I have a branch locally for switching to nox because it will be easier for us to modify the testing infrastructure and bring it closer to the Scientific Python ecosystem's guidelines – but I don't wish to hold up your PR at this time, so this is ready for review.

@agriyakhetarpal
Copy link
Collaborator Author

Lots of potential improvements and maintenance to do, I'm excited 😄

@agriyakhetarpal
Copy link
Collaborator Author

Just realised I pushed the previous commit to master when I meant to do so here – we should set up branch protections.

@agriyakhetarpal
Copy link
Collaborator Author

I don't have access to change branch protection rules in the settings. @j-towns, could you please help us out with this? Also, since not many PRs are active, we could additionally look at renaming master to main.

@j-towns
Copy link
Collaborator

j-towns commented Aug 1, 2024

Yep, since they're not urgent I'll look at those things in around 10 days when I'm back from holiday.

@agriyakhetarpal
Copy link
Collaborator Author

Sure, thanks! Enjoy your holiday!

@agriyakhetarpal
Copy link
Collaborator Author

@fjosw, please let me know if this is good to go for you – I'm awaiting your review :) I think it is, at least from my end.

Copy link
Collaborator

@fjosw fjosw left a comment

Choose a reason for hiding this comment

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

Hi @agriyakhetarpal, sorry for the delay, your changes look good to me! I guess "numpy<2" is only temporary to let the tests pass?

@agriyakhetarpal agriyakhetarpal merged commit 7832b4b into master Aug 13, 2024
18 checks passed
@agriyakhetarpal agriyakhetarpal deleted the chore/migrate-to-hatch branch August 13, 2024 18:02
@agriyakhetarpal
Copy link
Collaborator Author

Thanks for the review, and no worries about the delay! Yes, the upper pin is just temporary – just updated your branch in the other PR where the pin doesn't exist 😄

@agriyakhetarpal agriyakhetarpal restored the chore/migrate-to-hatch branch August 20, 2024 10:30
@agriyakhetarpal agriyakhetarpal deleted the chore/migrate-to-hatch branch August 20, 2024 10:30
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.

Python 2 and dependency on future
3 participants