-
Notifications
You must be signed in to change notification settings - Fork 237
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
anaconda-client doesn't know how to read valid metadata from non-setuptools build backends #676
Comments
@vshevchenko-anaconda Feel free to close given that I'm somehow unable to replicate this (in the same Docker image as yesterday(?)) from the state of scientific-python/upload-nightly-action#27 as things are now properly failing out with
for an invalid token (as I don't want to upload for these issue discussions) $ docker run --rm -ti -v $PWD:/work:ro mambaorg/micromamba:1.4.9-bullseye-slim /bin/bash
(base) mambauser@2a53f5d1c960:/tmp$ micromamba --quiet install --channel conda-forge --yes build twine anaconda-client
(base) mambauser@2a53f5d1c960:/tmp$ python -m build --outdir ./dist /work/tests/test_package/ && twine check --strict dist/*
* Creating venv isolated environment...
* Installing packages in isolated environment... (hatchling)
* Getting dependencies for sdist...
* Building sdist...
* Building wheel from sdist
* Creating venv isolated environment...
* Installing packages in isolated environment... (hatchling)
* Getting dependencies for wheel...
* Building wheel...
Successfully built test_package-0.0.1.tar.gz and test_package-0.0.1-py3-none-any.whl
Checking dist/test_package-0.0.1-py3-none-any.whl: PASSED
Checking dist/test_package-0.0.1.tar.gz: PASSED
(base) mambauser@2a53f5d1c960:/tmp$ anaconda --token fail upload --user scientific-python-nightly-wheels ./dist/*.whl
Using Anaconda API: https://api.anaconda.org
Using "scientific-python-nightly-wheels" as upload username
Processing "./dist/test_package-0.0.1-py3-none-any.whl"
Detecting file type...
File type is "Standard Python"
Extracting standard python attributes for upload
Creating package "test-package"
[ERROR] ('Authorization token is no longer valid', 401)
(base) mambauser@2a53f5d1c960:/tmp$ it would perhaps be interesting to still know what the required metadata is for |
@vshevchenko-anaconda Hm, apparently there is a problem though as when the GitHub Action runs with a valid token (c.f. scientific-python/upload-nightly-action#27 (comment)) we are getting this failure I mentioned later on in the logs. (this example has
This is strange as the GitHub Action uses the same Docker image that I used in the example in #676 (comment). |
twine check --strict
@vshevchenko-anaconda The problem is apparently however I tested this by keeping everything else the same and switching build backends from --- a/tests/test_package/pyproject.toml
+++ b/tests/test_package/pyproject.toml
@@ -1,6 +1,6 @@
[build-system]
-requires = ["hatchling"]
-build-backend = "hatchling.build"
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
[project]
name = "test-package" This is pretty serious as this means that you're requiring a specific build backend to have build a Python package. |
* Add simplest example package to tests so that it can be built for upload to Anaconda cloud as a test of the action. - Use setuptools as the build backend over something more obvious like hatchling given the simple nature of the test-package given that anaconda-client v1.12.0 doesn't understand valid metadata from PEP 518 build backends other than setuptools. c.f. anaconda/anaconda-client#676 * Add CI GitHub Action workflow to test the functionality of the action as shown in the README.
* Add simplest example package to tests so that it can be built for upload to Anaconda cloud as a test of the action. - Use setuptools as the build backend over something more obvious like hatchling given the simple nature of the test-package given that anaconda-client v1.12.0 doesn't understand valid metadata from PEP 518 build backends other than setuptools. c.f. anaconda/anaconda-client#676 * Add CI GitHub Action workflow to test the functionality of the action as shown in the README.
* Add simplest example package to tests so that it can be built for upload to Anaconda cloud as a test of the action. - Use setuptools as the build backend over something more obvious like hatchling given the simple nature of the test-package given that anaconda-client v1.12.0 doesn't understand valid metadata from PEP 518 build backends other than setuptools. c.f. anaconda/anaconda-client#676 * Add CI GitHub Action workflow to test the functionality of the action as shown in the README.
* Add simplest example package to tests so that it can be built for upload to Anaconda cloud as a test of the action. - Use setuptools as the build backend over something more obvious like hatchling given the simple nature of the test-package given that anaconda-client v1.12.0 doesn't understand valid metadata from PEP 518 build backends other than setuptools. c.f. anaconda/anaconda-client#676 * Add CI GitHub Action workflow to test the functionality of the action as shown in the README.
@ofek, while this isn't your problem to fix, I thought I might tag you here in the event that you can provide information that might help move this along. |
Are you able to modify the code that checks validity so that we may see the actual traceback? |
I would need to build and install |
* Add simplest example package to tests so that it can be built for upload to Anaconda cloud as a test of the action. - Use setuptools as the build backend over something more obvious like hatchling given the simple nature of the test-package given that anaconda-client v1.12.0 doesn't understand valid metadata from PEP 518 build backends other than setuptools. c.f. anaconda/anaconda-client#676 * Add CI GitHub Action workflow to test the functionality of the action as shown in the README.
@csoja @vshevchenko-anaconda any chance that this could get looked at in the near future to figure out why |
As part of scientific-python/upload-nightly-action#15 I'm building a test package to upload following https://packaging.python.org/en/latest/tutorials/packaging-projects/. This minimal package
contains sufficient build information to be built with
hatchling
and be validated bytwine
However,
anaconda-client
v1.12.0
does not view it as having valid metadataraising (I think) the exception block here
https://github.com/Anaconda-Platform/anaconda-client/blob/bb2e957b588a07ddd806b791ac367fa88b49ccb1/binstar_client/commands/upload.py#L253-L266
As
anaconda-client
apparently doesn't agree withtwine
on what is required metadata can you please specify what the required metadata is?The text was updated successfully, but these errors were encountered: