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

Failing to install v 0.6.0 with pypi tarball #435

Closed
nilason opened this issue Dec 27, 2023 · 12 comments
Closed

Failing to install v 0.6.0 with pypi tarball #435

nilason opened this issue Dec 27, 2023 · 12 comments

Comments

@nilason
Copy link

nilason commented Dec 27, 2023

Building with pypi tarball fails with:

sudo port -vs install py311-spopt
--->  Computing dependencies for py311-spopt.
--->  Fetching distfiles for py311-spopt
--->  Verifying checksums for py311-spopt
--->  Checksumming spopt-0.6.0.tar.gz
--->  Extracting py311-spopt
--->  Extracting spopt-0.6.0.tar.gz
Executing:  cd "/opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/py-spopt/spopt-0.6.0.tar.gz' | /usr/bin/tar -xf - 
--->  Configuring py311-spopt
--->  Building py311-spopt
Executing:  cd "/opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work/spopt-0.6.0" && /opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work 
* Getting build dependencies for wheel...
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
    self.run_setup()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
    exec(code, locals())
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 147, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/dist.py", line 303, in __init__
    _Distribution.__init__(self, dist_attrs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
    self.finalize_options()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/dist.py", line 680, in finalize_options
    ep(self)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools_scm/_integration/setuptools.py", line 121, in infer_version
    _assign_version(dist, config)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools_scm/_integration/setuptools.py", line 56, in _assign_version
    _version_missing(config)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools_scm/_get_version_impl.py", line 112, in _version_missing
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for /opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work/spopt-0.6.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

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
Command failed:  cd "/opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work/spopt-0.6.0" && /opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work 
Exit code: 1
Error: Failed to build py311-spopt: command execution failed
Error: See /opt/local/var/macports/logs/_Users_nilason_ports_python_py-spopt/py311-spopt/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port py311-spopt failed

@jGaboardi
Copy link
Member

@nilason In order to attempt to trouble shoot this we'll need more information, like specific OS etc. However, I have personally never seen this problem and our artifacts are all created with a GHA. Perhaps other devs have an idea?

cc @gegen07 @ljwolf @martinfleis @knaaptime

@martinfleis
Copy link
Member

I am not able to reproduce the issue with pip install spopt-0.6.0.tar.gz. And I don't know what sudo port -vs install py311-spopt is doing apart from that.

@jGaboardi
Copy link
Member

Seems like it may be related to an Apple Silicon difference >> giotto-ai/giotto-tda#308

@martinfleis
Copy link
Member

Just for the record, I was installing it on apple silicon.

@nilason
Copy link
Author

nilason commented Jan 4, 2024

I have been responsible of updating the pysal family of modules for MacPorts, since the split into separate modules. The log above is a taken from such an attempt to install. It is not building with pip, but with build. There have so far been no problem with any of the other pysal modules, even with the modernised ones. I just can't tell where the difference is or where the problem is.
(I am working on an ARM Mac, but I doubt that is the cause).

@nilason
Copy link
Author

nilason commented Jan 4, 2024

A lot of the log is MacPorts specific and maybe not clear for everyone, the main line (command) is:

Executing:  cd "/opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work/spopt-0.6.0" && /opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 -m build --no-isolation --wheel --outdir /opt/local/var/macports/build/_Users_nilason_ports_python_py-spopt/py311-spopt/work 

@nilason
Copy link
Author

nilason commented Jan 4, 2024

Comparing the tarball spopt-0.6.0.tar.gz with spaghetti-1.7.4.tar.gz I note there are contents present in the latter, missing in the former:

  • PGK-INFO
  • setup.cfg
  • *.egg-info

@jGaboardi
Copy link
Member

@martinfleis mentioned that he has actually seen this error before.

One thing we can do is check how the spopt action differs from other recent PySAL releases:segregation, tobler, momepy, etc...

@martinfleis
Copy link
Member

Comparing the tarball spopt-0.6.0.tar.gz with spaghetti-1.7.4.tar.gz I note there are contents present in the latter, missing in the former:

I see all three in both spopt tarball and spaghetti tarball. Using this link rather than the one above that somehow downloads a zero byte file on my side.

Screenshot 2024-01-04 at 22 44 02

@nilason are we pulling the same tarball?

@nilason
Copy link
Author

nilason commented Jan 4, 2024

pythonhosted redirects non-hash links, make sure you enable redirection on download. Tomorrow I will double check my tarballs.

@nilason
Copy link
Author

nilason commented Jan 5, 2024

I'm awfully sorry for my mistake and the noise! I forgot (and overlooked) that the tarball for spotp was downloaded from GH (to enable the tests). Now it works fine (tests too) with tarball from pythonhosted (which also is the preferred location for MacPorts). Thanks!

@nilason nilason closed this as completed Jan 5, 2024
@jGaboardi
Copy link
Member

@nilason No problem at all! Thanks for the work you do!

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

No branches or pull requests

3 participants