Code Monkey home page Code Monkey logo

Comments (6)

mk-fg avatar mk-fg commented on May 24, 2024

I think issue is likely with older setuptools that you might be using there - it seem to work here with setuptools-68.0.0.

And given giant banner warning that it produces these days (see below, though you have similar one in your output), I'd suggest to avoid using setuptools and "python setup.py" command entirely, if that is an option.
(e.g. maybe use "python -m venv" if you can, pretty sure that should always pull latest python packaging tools, avoiding the issue)

If it's for old project, with old build process and dependencies, maybe just stick with older pyaml version as well, as it'd be more likely to work with any other stuff installed there (e.g. python 3.10 and other modules that might be using it) - 23.x.x has couple potentially-breaking changes that you might avoid that way.

Proper fix might be restoring setup.py file from earlier 21.x version, which was nuked in 6b9113e , but I don't think it's common enough to use older setuptools on a system without venv or pip and such, to maintain setup.py for.

Though also, gotta admit that python packaging tools always look confusing for me, with 10 ways of doing same thing in there, so maybe I don't understand the issue and what should be used these days either.

% curl -OL https://files.pythonhosted.org/packages/e5/c1/ad25b528ba5e7039ec0939330d6ddb05212033f5fe0041e90daf5bb3b0da/pyaml-23.5.9.tar.gz
% tar -xf pyaml-23.5.9.tar.gz
% cd pyaml-23.5.9
% python setup.py install --root=/tmp/test

/usr/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py:72: _BetaConfiguration: Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*.
  config = read_configuration(filepath, True, ignore_option_errors, dist)
validate_pyproject.api.load_builtin_plugin defines `tool.distutils` schema
validate_pyproject.api.load_builtin_plugin defines `tool.setuptools` schema
running install
/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running build
running build_py
creating build
creating build/lib
creating build/lib/pyaml
copying pyaml/__init__.py -> build/lib/pyaml
copying pyaml/__main__.py -> build/lib/pyaml
creating build/lib/pyaml/tests
copying pyaml/tests/__init__.py -> build/lib/pyaml/tests
copying pyaml/tests/test_dump.py -> build/lib/pyaml/tests
running egg_info
writing pyaml.egg-info/PKG-INFO
writing dependency_links to pyaml.egg-info/dependency_links.txt
writing requirements to pyaml.egg-info/requires.txt
writing top-level names to pyaml.egg-info/top_level.txt
reading manifest file 'pyaml.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'COPYING'
writing manifest file 'pyaml.egg-info/SOURCES.txt'
warning: build_py: byte-compiling is disabled, skipping.

running install_lib
creating /tmp/test
creating /tmp/test/usr
creating /tmp/test/usr/lib
creating /tmp/test/usr/lib/python3.11
creating /tmp/test/usr/lib/python3.11/site-packages
creating /tmp/test/usr/lib/python3.11/site-packages/pyaml
copying build/lib/pyaml/__init__.py -> /tmp/test/usr/lib/python3.11/site-packages/pyaml
copying build/lib/pyaml/__main__.py -> /tmp/test/usr/lib/python3.11/site-packages/pyaml
creating /tmp/test/usr/lib/python3.11/site-packages/pyaml/tests
copying build/lib/pyaml/tests/__init__.py -> /tmp/test/usr/lib/python3.11/site-packages/pyaml/tests
copying build/lib/pyaml/tests/test_dump.py -> /tmp/test/usr/lib/python3.11/site-packages/pyaml/tests
warning: install_lib: byte-compiling is disabled, skipping.

running install_egg_info
Copying pyaml.egg-info to /tmp/test/usr/lib/python3.11/site-packages/pyaml-23.5.9-py3.11.egg-info
running install_scripts

% find /tmp/test

/tmp/test
/tmp/test/usr
/tmp/test/usr/lib
/tmp/test/usr/lib/python3.11
/tmp/test/usr/lib/python3.11/site-packages
/tmp/test/usr/lib/python3.11/site-packages/pyaml-23.5.9-py3.11.egg-info
/tmp/test/usr/lib/python3.11/site-packages/pyaml-23.5.9-py3.11.egg-info/top_level.txt
/tmp/test/usr/lib/python3.11/site-packages/pyaml-23.5.9-py3.11.egg-info/requires.txt
/tmp/test/usr/lib/python3.11/site-packages/pyaml-23.5.9-py3.11.egg-info/dependency_links.txt
/tmp/test/usr/lib/python3.11/site-packages/pyaml-23.5.9-py3.11.egg-info/SOURCES.txt
/tmp/test/usr/lib/python3.11/site-packages/pyaml-23.5.9-py3.11.egg-info/PKG-INFO
/tmp/test/usr/lib/python3.11/site-packages/pyaml
/tmp/test/usr/lib/python3.11/site-packages/pyaml/tests
/tmp/test/usr/lib/python3.11/site-packages/pyaml/tests/test_dump.py
/tmp/test/usr/lib/python3.11/site-packages/pyaml/tests/__init__.py
/tmp/test/usr/lib/python3.11/site-packages/pyaml/__main__.py
/tmp/test/usr/lib/python3.11/site-packages/pyaml/__init__.py

from pretty-yaml.

nieder avatar nieder commented on May 24, 2024

I get the same failure type when using build/wheel to install:

$ /sw/bin/python3.10 -m build --wheel --no-isolation
* Building wheel...
running bdist_wheel
running build
installing to build/bdist.macosx-10.14-x86_64/wheel
running install
running install_egg_info
running egg_info
creating UNKNOWN.egg-info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
listing git files failed - pretending there aren't any
listing git files failed - pretending there aren't any
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'COPYING'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
Copying UNKNOWN.egg-info to build/bdist.macosx-10.14-x86_64/wheel/UNKNOWN-0.0.0-py3.10.egg-info
running install_scripts
adding license file "COPYING" (matched pattern "COPYING*")
creating build/bdist.macosx-10.14-x86_64/wheel/UNKNOWN-0.0.0.dist-info/WHEEL
creating '/sw/build.build/pyaml-py310-23.5.9-1/pyaml-23.5.9/dist/tmpxo9_yx4p/UNKNOWN-0.0.0-py3-none-any.whl' and adding 'build/bdist.macosx-10.14-x86_64/wheel' to it
adding 'UNKNOWN-0.0.0.dist-info/COPYING'
adding 'UNKNOWN-0.0.0.dist-info/METADATA'
adding 'UNKNOWN-0.0.0.dist-info/WHEEL'
adding 'UNKNOWN-0.0.0.dist-info/top_level.txt'
adding 'UNKNOWN-0.0.0.dist-info/RECORD'
removing build/bdist.macosx-10.14-x86_64/wheel
Successfully built UNKNOWN-0.0.0-py3-none-any.whl

$ /sw/bin/python3.10 -m unittest -vv
< ALL TESTS PASS >

$ find /tmp/build-root
/tmp/build-root/
/tmp/build-root/sw/
/tmp/build-root/sw/lib/
/tmp/build-root/sw/lib/python3.10/
/tmp/build-root/sw/lib/python3.10/site-packages/
/tmp/build-root/sw/lib/python3.10/site-packages/UNKNOWN-0.0.0.dist-info/
/tmp/build-root/sw/lib/python3.10/site-packages/UNKNOWN-0.0.0.dist-info/RECORD
/tmp/build-root/sw/lib/python3.10/site-packages/UNKNOWN-0.0.0.dist-info/WHEEL
/tmp/build-root/sw/lib/python3.10/site-packages/UNKNOWN-0.0.0.dist-info/COPYING
/tmp/build-root/sw/lib/python3.10/site-packages/UNKNOWN-0.0.0.dist-info/top_level.txt
/tmp/build-root/sw/lib/python3.10/site-packages/UNKNOWN-0.0.0.dist-info/METADATA

Is pyaml using setuptools under the hood even when using the more modern build/wheel frontend? Most other pymods I've set up (including older pyaml-21.10.1) work with either setup.py or build/wheel, which is why I thought the problem/incompatibility might be somewhere in what the new pyaml is expecting. I've also never seen the UNKNOWN-0.0.0 tags, so something clearly is missing. But you're right, it near impossible these days to know what python packaging tools to use and how they're supposed to behave. And my setuptools is older because newer versions break the numpy we have, and newer numpy is failing various tests :(

In that install you sent to /tmp/test, can you post the contents of requires.txt and dependency_links.txt ? Maybe there's some dep there I'm missing that's not obvious. Thanks.

from pretty-yaml.

mk-fg avatar mk-fg commented on May 24, 2024

I've also never seen the UNKNOWN-0.0.0 tags

I think it might be missing version and package name in old setup() call of setuptools, which is how pypa documents making fallback, which clearly doesn't work for older versions of something that does not yet parse those in pyproject.toml

Guess restoring it would still be simplier than having to know about what -m build is, how that differs between multiple python releases, and other minor incompatibilities :)

from pretty-yaml.

mk-fg avatar mk-fg commented on May 24, 2024

In that install you sent to /tmp/test, can you post the contents of requires.txt and dependency_links.txt ?
Maybe there's some dep there I'm missing that's not obvious. Thanks.

requires.txt:

PyYAML

[anchors]
unidecode

dependency_links.txt seem to only have two empty lines in it.

Don't think these should be important for how setuptools and such work, as presumably these are package dependencies, which tools that build/install package generate by parsing its metadata, and shouldn't have/need in advance.

from pretty-yaml.

mk-fg avatar mk-fg commented on May 24, 2024

Restored all setup.py keys by parsing those from pyproject.toml in 1efa7da / 23.7.0, so hopefully it should work same as before on its own, even if setuptools knows nothing about pyproject.toml yet.

Let me know if it still does not, as I haven't really reproduced your setup and issue, and maybe it's about something other than keywords in setup.py entirely.

from pretty-yaml.

nieder avatar nieder commented on May 24, 2024

That worked. The 23.7.0 build process now uses the name/version keys and the final build has all the expected files.
Thanks for taking time for this!

from pretty-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.