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 from setuptools to hatchling #1551

Merged
merged 4 commits into from
Aug 10, 2022
Merged

Conversation

pquentin
Copy link
Member

Python packaging is evolving quite rapidly and there are now multiple alternatives to setuptools. Additionally:

  • setuptools does not support editable installs yet, which required us to add --no-use-pep517 in various places
  • setuptools still requires a setup.py file (as you can see in Move most packaging metadata to pyproject.toml #1548) but we'd like to move to a fully declarative model
  • setuptools is slower than other backends and it produces confusing output
  • setuptools broke Rally a few times in the past, which we solved by pinning it

I hesitated between flit (minimal and simple, did not want to be the default recommendation) and hatch (more popular, doing more things, actively maintained). The main difference for our use case is how we select files that go in the distribution, and hatch is the first that I was able to get to work. All other parts are standardized, so switching is going to be easy until we start using more hatch features.

I tested:

  • installing Rally in development mode (make install), running it with ./rally
  • running tests, including integration tests
    • note tox now uses isolated builds, so the cleaning step is not needed anymore
  • running a fake release
  • building a Docker image

Before merging, we'll have to:

@pquentin pquentin added cleanup Linter changes, reformatting, removal of unused code etc. :internal Changes for internal, undocumented features: e.g. experimental, release scripts tech debt labels Jul 28, 2022
@pquentin pquentin added this to the 2.6.1 milestone Jul 28, 2022
@pquentin pquentin self-assigned this Jul 28, 2022
@elastic elastic deleted a comment from elasticmachine Aug 4, 2022
Copy link
Contributor

@michaelbaamonde michaelbaamonde left a comment

Choose a reason for hiding this comment

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

LGTM. I tested locally and also with some internal tooling that installs Rally from source using this branch.

The merge conflict is minor BTW.

pull bot pushed a commit to abitmore/rally that referenced this pull request Aug 9, 2022
Simply having a pyproject.toml file with a build-system entry as done in elastic#1548 means that `--no-use-pep517` is going to fail. This pull request integrates the relevant part of elastic#1551 to stop doing that.

We need to merge this before the nightly benchmarks run.
@pquentin
Copy link
Member Author

I merged from master and fixed the conflicts. I also reinstated tox-env-clean because it turns out it's still needed.

This pull request is now even smaller.

Copy link
Contributor

@michaelbaamonde michaelbaamonde left a comment

Choose a reason for hiding this comment

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

LGTM!

@pquentin pquentin merged commit d134860 into elastic:master Aug 10, 2022
@pquentin pquentin deleted the hatchling branch August 11, 2022 06:10
@pquentin pquentin added enhancement Improves the status quo and removed cleanup Linter changes, reformatting, removal of unused code etc. :internal Changes for internal, undocumented features: e.g. experimental, release scripts labels Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the status quo tech debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants