pytest-dev / pytest-flask

A set of pytest fixtures to test Flask applications

Home Page:http://pytest-flask.readthedocs.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setup.py can not be executed

stkw0 opened this issue · comments

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

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.

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

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

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.

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

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 :)