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

How to make the package work with setuptools lower than 61.0.0 #43

Closed
Mingli-Yu opened this issue Mar 21, 2024 · 4 comments
Closed

How to make the package work with setuptools lower than 61.0.0 #43

Mingli-Yu opened this issue Mar 21, 2024 · 4 comments

Comments

@Mingli-Yu
Copy link

I'm building the package from scratch.

For some reason, I work on a system with an old setuptools which does not support PEP621 and is unable to extract name and version metadata in pyproject.toml as pypa/setuptools#3269 (comment).

Is there any way to achieve the compatibility with the old setuptools? Thanks!

@tanbro
Copy link
Owner

tanbro commented Mar 25, 2024

Oh, pyyaml-include 2.0 has no plan for python earlier than 3.8.
as I known, python3.6 is mostly distributed with setuptools 59.6.0 by default, and python 3.7 is with setuptools 68.0.

Later, I'll review pyyaml-include 1.x , and try to make it work with python 3.6 and setuptools 59.x, which does not support PEP518/pyproject.toml

@tanbro
Copy link
Owner

tanbro commented Mar 25, 2024

@Mingli-Yu
v1.4.1 rollback to a pre PEP 518 build system. Python 3.6 support came back again, setuptools_scm and pyproject.toml was removed.

I think it may work on your environment.

@Mingli-Yu
Copy link
Author

Mingli-Yu commented Mar 27, 2024

Thanks @tanbro , the new version 1.4.1 works well in my env with lower setuptools. Thank you very much!

@tanbro
Copy link
Owner

tanbro commented Mar 29, 2024

@Mingli-Yu all right ;)

halstead pushed a commit to openembedded/meta-openembedded that referenced this issue Apr 28, 2024
* Upgrade to 1.4.1 to make it work with setuptools 59.x as it doesn't
support pep 621 [1], so remove pyproject.toml and add setup.cfg back [2].

* Add python3-toml to RDEPENDS to fix below error:
 self = <yamlinclude.readers.TomlReader object at 0x7faceccdbd30>

     def __call__(self):
         if sys.version_info >= (3, 11):
             with open(self._path, "rb") as fp:
                 return tomllib.load(fp)
         else:
             try:
                 import toml
             except ImportError as err:  # pragma: no cover
 >               raise ImportError(f'Un-supported file "{self._path}".\n`pip install toml` should solve the problem.\n\n{err}')
 E               ImportError: Un-supported file "tests/data/include.d/1.toml".
 E               `pip install toml` should solve the problem.
 E
 E               No module named 'toml'

 ../../python3.10/site-packages/yamlinclude/readers.py:69: ImportError

[1] https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[2] tanbro/pyyaml-include#43

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
jpuhlman pushed a commit to MontaVista-OpenSourceTechnology/meta-openembedded that referenced this issue May 29, 2024
Source: meta-openembedded
MR: 144254
Type: Integration
Disposition: Merged from meta-openembedded
ChangeID: a246e26
Description:

* Upgrade to 1.4.1 to make it work with setuptools 59.x as it doesn't
support pep 621 [1], so remove pyproject.toml and add setup.cfg back [2].

* Add python3-toml to RDEPENDS to fix below error:
 self = <yamlinclude.readers.TomlReader object at 0x7faceccdbd30>

     def __call__(self):
         if sys.version_info >= (3, 11):
             with open(self._path, "rb") as fp:
                 return tomllib.load(fp)
         else:
             try:
                 import toml
             except ImportError as err:  # pragma: no cover
 >               raise ImportError(f'Un-supported file "{self._path}".\n`pip install toml` should solve the problem.\n\n{err}')
 E               ImportError: Un-supported file "tests/data/include.d/1.toml".
 E               `pip install toml` should solve the problem.
 E
 E               No module named 'toml'

 ../../python3.10/site-packages/yamlinclude/readers.py:69: ImportError

[1] https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[2] tanbro/pyyaml-include#43

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Jeremy A. Puhlman <jpuhlman@mvista.com>
mmitchel pushed a commit to distro-core-curated-mirrors/meta-openembedded-contrib that referenced this issue Jun 3, 2024
* Upgrade to 1.4.1 to make it work with setuptools 59.x as it doesn't
support pep 621 [1], so remove pyproject.toml and add setup.cfg back [2].

* Add python3-toml to RDEPENDS to fix below error:
 self = <yamlinclude.readers.TomlReader object at 0x7faceccdbd30>

     def __call__(self):
         if sys.version_info >= (3, 11):
             with open(self._path, "rb") as fp:
                 return tomllib.load(fp)
         else:
             try:
                 import toml
             except ImportError as err:  # pragma: no cover
 >               raise ImportError(f'Un-supported file "{self._path}".\n`pip install toml` should solve the problem.\n\n{err}')
 E               ImportError: Un-supported file "tests/data/include.d/1.toml".
 E               `pip install toml` should solve the problem.
 E
 E               No module named 'toml'

 ../../python3.10/site-packages/yamlinclude/readers.py:69: ImportError

[1] https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
[2] tanbro/pyyaml-include#43

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants