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

packaging: migrate to declarative setup.cfg #151

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

deronnax
Copy link
Contributor

@deronnax deronnax commented Oct 31, 2023

declarative setup.cfg are superior to imperative setup.py.

I added a minimalist tox.ini. I took the initiative to change what's in the long description: CHANGES.rst is not appended anymore to the README.

@gforcada
Copy link
Owner

gforcada commented Nov 1, 2023

@deronnax thanks a lot for spending the time improving flake8-isort!! 🎉 🙇🏾

Though, if we are moving out of setup.py I would move straight to pyproject.toml which is the blessed file for managing projects. Fortunately setup.cfg and pyproject.toml don't differ too much one from the other 🤞🏾

See https://packaging.python.org/en/latest/tutorials/packaging-projects/#creating-pyproject-toml

Adding a tox.ini sounds great 🌟 but unfortunately I do like to have CHANGES.rst appended, so within a first glance on PyPI I can see what were the changes made on the distribution recently.

I would be all fine and understandable that these requested changes above are too much, I could do them myself if you want 😄

@deronnax
Copy link
Contributor Author

deronnax commented Nov 2, 2023

@gforcada no worries, I will soon come back with all your requests addressed. Hold on.

@gforcada
Copy link
Owner

gforcada commented Nov 3, 2023

Cool, thanks! 🙇🏾

I will slightly adapt it to follow the other flake8 plugins I'm maintaining, but that's almost all the work done with this PR! 🌟

@gforcada gforcada merged commit 63f32a2 into gforcada:master Nov 3, 2023
10 checks passed
@deronnax
Copy link
Contributor Author

deronnax commented Nov 3, 2023

Hey, thank you for the merge, I had not integrated one change you asked for : the appending of changes.rst to the readme.rst, because you have to fiddle a bit the pyproject.toml to get it.
If you really want (which I still advice against, but you do you), apply this diff:

--- a/pyproject.toml
+++ b/pyproject.toml
@@ -9,7 +9,7 @@ authors = [{ name = "Gil Forcada", email = "[email protected]" }]
 license = { text = "GPL version 2" }
 description = "flake8 plugin that integrates isort ."
 keywords = ["pep8", "flake8", "python", "isort", "imports"]
-readme = "README.rst"
+dynamic = ["readme"]
 classifiers = [
     "Development Status :: 5 - Production/Stable",
     "Environment :: Console",
@@ -33,6 +33,9 @@ urls = { Homepage = "https://github.com/gforcada/flake8-isort" }
 requires-python = ">=3.8"
 dependencies = ["flake8", "isort >= 5.0.0, <6"]
 
+[tool.setuptools.dynamic]
+readme = { file = ["README.rst", "CHANGES.rst"] }
+
 [project.entry-points]
 "flake8.extension" = { I00 = "flake8_isort:Flake8Isort" }

There you go. Have a good day :)

@gforcada
Copy link
Owner

gforcada commented Nov 3, 2023

@deronnax Thanks for the patch! 🌟 but given that PyPI now has the URLs structure where you can provide a link to the ChangeLog, I would say that it is solved 😄

I also moved away from setuptools and I'm using hatchling now 🍀

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