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

Put dependencies/project information in pyproject.toml instead of setup.cfg (PEP621) #2336

Merged
merged 12 commits into from
Apr 14, 2023

Conversation

JE-Chen
Copy link
Contributor

@JE-Chen JE-Chen commented Apr 13, 2023

Add pep621_pyproject.toml

  • This TOML file complies with PEP517 & PEP518 & PEP621

This link is for the PYPI package generated by this TOML file.

I don't want to overwrite old pyproject.toml so i call this file pep621_pyproject.toml

PEP621

JE-Chen and others added 4 commits April 13, 2023 18:09
Add PEP621 format toml file
Add pep621_pyproject.toml

* This TOML file complies with PEP517 & PEP518 & PEP621

This link is for the PYPI package generated by this TOML file.

* https://pypi.org/project/locust-je-test-pep621/2.15.2.dev8/

I don't want to overwrite old pyproject.toml so i call this file pep621_pyproject.toml
Remove duplicate zip_safe
@cyberw
Copy link
Collaborator

cyberw commented Apr 13, 2023

Nice. But go ahead and add it to pyproject.toml, otherwise it will not be tested before merging etc. We definitely dont want to have both at the same time. Is this compatible with Python 3.7 btw?

You'll need to merge this with latest master to get the build working (because of this #2337)

@JE-Chen
Copy link
Contributor Author

JE-Chen commented Apr 14, 2023

Is this compatible with Python 3.7 btw?
Sure, but we need pip upgrade build & setuptools (setuptools>=61) first.

Built success on python 3.7.7 in Windows 11 & Ubuntu 22.0.4
image

PEP621 allows pyproject.toml to generate the package on its own, but CI/CD requires setup.cfg so I didn't delete it.

The link to the package generated using only pyproject.toml.
https://pypi.org/project/locust-je-test-pep621/2.15.2.dev15/

If both setup.cfg and pyproject.toml exist, I think pyproject.toml will overwrite [metadata] in setup.cfg.
image

Remove duplicate setuptools_scm on build system requires & old pyproject
from license = { file = "LICENSE"}
to license = { text = "MIT"}

because we have this options
license-files = ["LICENSE"]
@cyberw
Copy link
Collaborator

cyberw commented Apr 14, 2023

PEP621 allows pyproject.toml to generate the package on its own, but CI/CD requires setup.cfg so I didn't delete it.

Hm. If we'd have to maintain duplicate dependencies in setup.cfg I dont think this is worth it.

Delete setup.cfg & setup.py
@JE-Chen
Copy link
Contributor Author

JE-Chen commented Apr 14, 2023

Look like we don't need setup.cfg & setup.py anymore

what this test step do?
image

@cyberw
Copy link
Collaborator

cyberw commented Apr 14, 2023

That just ensures pip cache uniqueness. The cache is an optimization for faster (repeated) builds on GH. I think you can replace 'setup.cfg' with 'pyproject.toml'

Replace 'setup.cfg' with 'pyproject.toml'
@cyberw
Copy link
Collaborator

cyberw commented Apr 14, 2023

Makefile needs to be adjusted too, as this doesnt work anymore:

build:
	rm -f dist/* && python3 setup.py sdist bdist_wheel

…ist/* && python3 -m build .

Replace
rm -f dist/* && python3 setup.py sdist bdist_wheel
to
 rm -f dist/* && python3 -m build .
@cyberw
Copy link
Collaborator

cyberw commented Apr 14, 2023

While you are at it, you can nuke examples/vagrant/vagrant.sh.

It contains a reference to setup.py which will stop working now. And the file hasnt been updated in 11 (!) years :)

@cyberw
Copy link
Collaborator

cyberw commented Apr 14, 2023

Hmm...
image

@JE-Chen
Copy link
Contributor Author

JE-Chen commented Apr 14, 2023

We need "pip install --upgrade build" first

@cyberw
Copy link
Collaborator

cyberw commented Apr 14, 2023

We need "pip install --upgrade build" first

Yea, I was in a virtualenv and forgot to install it. Oops. Do you wanna remove vagrant.sh or should I?

Nuke examples\vagrant\vagrant.sh and
add pip upgrade build on Makefile
@cyberw cyberw changed the title Add pep621_pyproject.toml Put dependencies/package information in pyproject.toml instead of setup.cfg (PEP621) Apr 14, 2023
@cyberw cyberw merged commit 908c414 into locustio:master Apr 14, 2023
12 checks passed
@cyberw
Copy link
Collaborator

cyberw commented Apr 14, 2023

Good stuff, thanks!

@cyberw cyberw changed the title Put dependencies/package information in pyproject.toml instead of setup.cfg (PEP621) Put dependencies/project information in pyproject.toml instead of setup.cfg (PEP621) Apr 14, 2023
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