Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Create 3.0.0-dev.2 #307

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

Merged
merged 3 commits into from
Nov 1, 2020
Merged

Conversation

tomschr
Copy link
Member

@tomschr tomschr commented Nov 1, 2020

This PR contains:

  • Build changelog from news files

However, trying to upload it to TestPyPI gives me the following error:

$ twine-3.6 --version
twine version 1.13.0 (pkginfo: 1.4.2, requests: 2.22.0, setuptools: 40.5.0,
requests-toolbelt: 0.9.1, tqdm: 4.31.1)

$ tox -e prepare-dist
[...]
prepare-dist run-test: commands[1] | twine check 'dist/*'
Checking dist/semver-3.0.0.dev2-py3-none-any.whl: PASSED
Checking dist/semver-3.0.0.dev2.tar.gz: PASSED

$ twine-3.6 upload --repository testpypi dist/* 
Uploading distributions to https://test.pypi.org/legacy/
Uploading semver-3.0.0.dev2-py3-none-any.whl
100%|█████████████████████████████████████████████| 24.2k/24.2k [00:01<00:00, 14.3kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Client Error: 'attr: semver.__about__.__author_email__' is an invalid value for
Author-email.
Error: Use a valid email address See https://packaging.python.org/specifications/core-metadata
for more information. for url: https://test.pypi.org/legacy/

I also tried it with latest twine (version 3.2.0) without success.

@tlaferriere Thomas, do you know how this can be solved? Seems twine or (Test)PyPI doesn't understand our new setup.cfg. 😢 Seems this is not really supported... 🤔

* Build changelog from news files
@tomschr tomschr self-assigned this Nov 1, 2020
@tlaferriere
Copy link
Contributor

Looks like it is using an old version of setuptools. I think I saw version >=43.x somewhere in the docs about the setup.cfg only support. I don't know if you could update it to something more recent?

@tomschr
Copy link
Member Author

tomschr commented Nov 1, 2020

Nope. I checked that already and added a little change in tox.ini to make sure I have the latest setuptools:

diff --git i/tox.ini w/tox.ini
index 73fbfc5..d6c17df 100644
--- i/tox.ini
+++ w/tox.ini
@@ -95,7 +95,9 @@ basepython = python3
 deps =
     wheel
     twine
+    setuptools >= 43
 commands =
+    # just to make sure we see what's installed:
+    pip list
     python3 setup.py sdist bdist_wheel
     twine check dist/*

when I run it

$ rm -rf build/ dist/
$ tox -e prepare-dist
[...]
prepare-dist run-test: commands[0] | pip list
[...]
semver             3.0.0.dev2
setuptools         50.3.2    
[...]
prepare-dist run-test: commands[2] | twine check 'dist/*'
Checking dist/semver-3.0.0.dev2-py3-none-any.whl: PASSED
Checking dist/semver-3.0.0.dev2.tar.gz: PASSED

As you can see, I have even setuptools version >50. When I extract the METADATA from the wheel file, I get:

$ cat /tmp/semver3.0.0-dev.2/semver-3.0.0.dev2.dist-info/METADATA
[...]
Version: 3.0.0.dev2
Summary: attr: semver.__about__.__description__
Home-page: https://github.com/python-semver/python-semver
Author: attr: semver.__about__.__author__
Author-email: attr: semver.__about__.__author_email__
Maintainer: attr: semver.__about__.__maintainer__
Maintainer-email: attr: semver.__about__.__maintainer_email__
[...]

Either this is a bug in setuptools or we did something wrong. 😄

Maybe we need to overwrite the build_wheel command and replace the parts. I think the new setup.cfg is awesome and I would like to keep it.

@tomschr
Copy link
Member Author

tomschr commented Nov 1, 2020

Interesting... after a closer look, the Version in the above METAFILE has replaced the version from semver.__about__.__version__ but not the others variables. 🤔

@tomschr
Copy link
Member Author

tomschr commented Nov 1, 2020

I think I've found the culprit. According to the table in Metadata section of the setuptools documentation:

Key Aliases Type Minimum Version Notes
name   str    
version   attr:, file:, str 39.2.0  
url home-page str    
download_url download-url str  
description summary file:, str*
project_urls   dict 38.3.0  
author   str*    
author_email author-email str*    
maintainer   str*    
maintainer_email maintainer-email str*    

That means, the attr: key is only allowed in version (where it works), but not for author and the other keys (see str*). Only strings are allowed. 😞

Seems I need to replace them with the real values.

Due to https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html#metadata
we cannot use the "attr:" type in the keywords author, author_email, maintainer,
description, and maintainer_email.

If we do not change it to literal strings, twine (or PyPI) complains about the metadata
with the following error:

HTTPError: 400 Client Error: 'attr: semver.__about__.__author_email__' is an invalid value for
Author-email.
@tomschr tomschr force-pushed the release/3.0.0-dev.2 branch from 8685158 to 6a5ba32 Compare November 1, 2020 22:05
@tomschr
Copy link
Member Author

tomschr commented Nov 1, 2020

Success! 🎉 After I've updated the fields above, I could upload the files to TestPyPI: https://test.pypi.org/project/semver/3.0.0.dev2/

@tomschr tomschr merged commit e7558a9 into python-semver:master Nov 1, 2020
@tomschr tomschr deleted the release/3.0.0-dev.2 branch November 1, 2020 22:14
@tlaferriere
Copy link
Contributor

Oh no, such a specific limitation. I wish we could use attr in more places. I think I'll go read the issues over in the setuptools repo to see if anyone has suggested this already.

@tomschr
Copy link
Member Author

tomschr commented Nov 2, 2020

That would be great. 👍I think this is such a nice and elegant feature.
For the moment, it's hard-coded, but if you find a better solution we can always publish a next dev release. 😉

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.