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

setup.py can not be executed #156

Closed
stkw0 opened this issue Jun 11, 2022 · 6 comments
Closed

setup.py can not be executed #156

stkw0 opened this issue Jun 11, 2022 · 6 comments
Labels

Comments

@stkw0
Copy link

stkw0 commented Jun 11, 2022

When downloading source code from git archive or pypi setup.py can not be executed. Running python setup.py returns the next error

/usr/lib/python3.9/site-packages/setuptools/config/expand.py:144: UserWarning: File '/tmp/portage/dev-python/pytest-flask-1.2.0/work/pytest-flask-1.2.0/CHANGELOG.rst' cannot be found
  warnings.warn(f"File {path!r} cannot be found")
Traceback (most recent call last):
  File "/tmp/portage/dev-python/pytest-flask-1.2.0/work/pytest-flask-1.2.0/setup.py", line 23, in <module>
    setup(
  File "/usr/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 109, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python3.9/site-packages/setuptools/dist.py", line 477, in __init__
    _Distribution.__init__(
  File "/usr/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
    self.finalize_options()
  File "/usr/lib/python3.9/site-packages/setuptools/dist.py", line 901, in finalize_options
    ep(self)
  File "/usr/lib/python3.9/site-packages/setuptools/dist.py", line 922, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/usr/lib/python3.9/site-packages/setuptools_scm/integration.py", line 75, in version_keyword
    _assign_version(dist, config)
  File "/usr/lib/python3.9/site-packages/setuptools_scm/integration.py", line 51, in _assign_version
    _version_missing(config)
  File "/usr/lib/python3.9/site-packages/setuptools_scm/__init__.py", line 106, in _version_missing
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for /tmp/portage/dev-python/pytest-flask-1.2.0/work/pytest-flask-1.2.0.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

I'm using python 3.9.13

@stkw0 stkw0 added the bug label Jun 11, 2022
@PhysicsMD
Copy link

I believe this might be an issue with the pi version and its compatibility, I would urge a 3.8 version as more things are 3.8 ready and seems to be the most used version.

@nicoddemus
Copy link
Member

Seems like this is expected, due to limitations of setuptools-scm? However downloading the tarball from PyPI should work, as stated in the message.

@stkw0
Copy link
Author

stkw0 commented Jun 13, 2022

I also tried it from the tarball from PyPI but the error was the same.

@HLFH
Copy link

HLFH commented Jan 4, 2023

On Arch Linux, I had this issue on the python-pytest-flask package. I took ownership of the package, I have now fixed and updated it. The issue was with how this Arch Linux package was built and installed, and it was using a GitHub tarball instead of the Pythonhosted source.

@stkw0
Copy link
Author

stkw0 commented Aug 1, 2023

For the last version at least it seems that the issue is still present

@RonnyPfannschmidt
Copy link
Member

im under the impression portage keeps using non-recommended install sources intentionally and then complains

closing this as the error is indicative, but happy to accept a pr that adds a .git-archival configuration, however that has the caveat of github tarballs having unstable checksums and is unfixable :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants