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

setuptools_scm[toml]>=3.4.1 is incorrect and breaks jaraco/keyring builds in Fedora #16

Closed
ctubbsii opened this issue Apr 17, 2020 · 5 comments

Comments

@ctubbsii
Copy link

In #12 , which was merged to jaraco/keyring in jaraco/keyring@ab5920b

The syntax setuptools_scm[toml]>=3.4.1 instructs setuptools to use toml>=3.4.1, but that version doesn't exist (0.10.0 is latest).

It appears the intent was to require setuptools_scm>=3.4.1 and also setuptools_scm[toml]>0.10.0 or similar.

This breaks Fedora packaging of this, since Fedora tooling uses setuptools to set up RPM dependencies based on the required versions, specified in the setuptools config.

@ctubbsii
Copy link
Author

I don't really know enough about python tooling to know the specific details of how this is broken or how to fix it. Otherwise, I would have submitted a pull request. I'm hoping this is enough details to help somebody else figure it out, but if not, feel free to ask any questions. I'll answer as best I can to help troubleshoot this.

@ctubbsii
Copy link
Author

Never mind. I think this is my misunderstanding that the changes depend on newer versions of setuptools and setuptools_scm. I don't really understand it, but it seems to work if I specify:

diff --git a/pyproject.toml b/pyproject.toml
index 6ee7df2..aef1304 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,5 +1,5 @@
 [build-system]
-requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.1"]
+requires = ["setuptools>=41.6.0", "wheel", "setuptools_scm>=3.3.3"]
 build-backend = "setuptools.build_meta"
 
 [tool.black]
diff --git a/setup.cfg b/setup.cfg
index fe54b4a..bb05ab7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -26,7 +26,7 @@ install_requires =
 	SecretStorage>=3; sys_platform=="linux"
 	jeepney>=0.4.2; sys_platform=="linux"
 	importlib_metadata; python_version < "3.8"
-setup_requires = setuptools_scm[toml] >= 3.4.1
+setup_requires = setuptools_scm >= 3.3.3
 
 [options.extras_require]
 testing = 
diff --git a/setup.py b/setup.py
index bac24a4..827e955 100644
--- a/setup.py
+++ b/setup.py
@@ -3,4 +3,4 @@
 import setuptools
 
 if __name__ == "__main__":
-    setuptools.setup()
+    setuptools.setup(use_scm_version=True)

The one change that I think should still be applied is the use_scm_version=True in setup.py. That one causes the files to be created with version 0.0.0, and was already fixed once before in keyring-17.1.1, and seems to have regressed with these latest changes to use setuptools 42.

But, I won't keep the issue open for that change... since I don't know what the right way to configure it should be with the newer versions of setuptools.

@jaraco
Copy link
Owner

jaraco commented Aug 30, 2020

I just stumbled on this issue. I'll add some details to clarify, I hope.

setuptools_scm[toml]>=3.4.1 means "get setuptools_scm>=3.4.1 and include dependencies for the toml extra". In this case, the toml extra is just "toml" (any version is satisfactory).

The one change that I think should still be applied is the use_scm_version=True in setup.py

That parameter is obviated by ensuring setuptools_scm 3.4.1 or later (with toml), which honors the setting in pyproject.toml, namely the presence of the tool.setuptools_scm section, which is the recommended way to enable scm_version.

If you have more trouble, feel free to file another ticket here or with one of the relevant projects.

@ctubbsii
Copy link
Author

Thanks for the explanation, @jaraco . I'm still very novice with respect to python build tooling, but doing my best to help out with maintaining python-keyring in Fedora anyway (because I'm a big fan of the keyring CLI tool and use it extensively). These setuptools changes baffled me a bit (still do), but I think once Fedora has completely phased out the older setuptools_scm version, I think I'll have fewer problems with these things. 😺
In the meantime, do you know of any really good tutorials online for python setuptools and setuptools_scm work?

@jaraco
Copy link
Owner

jaraco commented Oct 5, 2020

I'm not aware of any good tutorials that specifically mention setuptools_scm except for setuptools_scm's own documentation. Do feel free to work with it and as you learn things that you wish were documented, consider contributing those back to the project. Thanks.

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

No branches or pull requests

2 participants