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

Add pyproject.toml #287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Apr 3, 2022

Explicitly declare that setuptools is the build backend
for this project, so it can be installed in environment
where setuptools is not pre-installed.

closes #276

Explicitly declare that setuptools is the build backend
for this project, so it can be installed in environment
where setuptools is not pre-installed.
@jcdrubay
Copy link

jcdrubay commented Apr 3, 2022

Hi @sbidoul
I tested with this branch and I am facing this error with python 3.7.9.

I get the same issue with both python 3.7.9 and 3.8.10.

Collecting git+https://github.com/acsone/openupgradelib.git@allow-install-without-setuptools (from -r ...)
  Cloning https://github.com/acsone/openupgradelib.git (to revision allow-install-without-setuptools) to /private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-req-build-hebn757w
  Running command git clone --filter=blob:none --quiet https://github.com/acsone/openupgradelib.git /private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-req-build-hebn757w
  Running command git checkout -b allow-install-without-setuptools --track origin/allow-install-without-setuptools
  Switched to a new branch 'allow-install-without-setuptools'
  Branch 'allow-install-without-setuptools' set up to track remote branch 'allow-install-without-setuptools' from 'origin'.
  Resolved https://github.com/acsone/openupgradelib.git to commit b37ac83c50b572360582541aceaa0ff4abbd19b5
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      Traceback (most recent call last):
        File "/Users/jc/.pyenv/versions/3.7.9/envs/kodoo-14/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Users/jc/.pyenv/versions/3.7.9/envs/kodoo-14/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/jc/.pyenv/versions/3.7.9/envs/kodoo-14/lib/python3.7/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 64, in <module>
          tests_require=test_requirements
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 109, in setup
          _setup_distribution = dist = klass(attrs)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 466, in __init__
          for k, v in attrs.items()
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
          self.finalize_options()
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 886, in finalize_options
          ep(self)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/overlay/lib/python3.7/site-packages/setuptools/dist.py", line 907, in _finalize_setup_keywords
          ep.load()(self, ep.name, value)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/integration.py", line 75, in version_keyword
          _assign_version(dist, config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/integration.py", line 48, in _assign_version
          maybe_version = _get_version(config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/__init__.py", line 151, in _get_version
          parsed_version = _do_parse(config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/__init__.py", line 98, in _do_parse
          version = _version_from_entrypoints(config) or _version_from_entrypoints(
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/_entrypoints.py", line 37, in _version_from_entrypoints
          version: Optional[ScmVersion] = _call_entrypoint_fn(root, config, ep.load())
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/_entrypoints.py", line 13, in _call_entrypoint_fn
          return fn(root, config=config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/git.py", line 147, in parse
          config, wd, describe_command=describe_command, pre_parse=pre_parse
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/git.py", line 188, in _git_parse_inner
          config=config,
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/version.py", line 193, in meta
          parsed_version = _parse_tag(tag, preformatted, config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/version.py", line 174, in _parse_tag
          tag = tag_to_version(tag, config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/setuptools_scm/version.py", line 80, in tag_to_version
          version = config.version_cls(version)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-cvf12jit/normal/lib/python3.7/site-packages/packaging/version.py", line 266, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      packaging.version.InvalidVersion: Invalid version: '13.0-slg-9cf6aaec3-openupgradelib'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@sbidoul
Copy link
Member Author

sbidoul commented Apr 4, 2022

@jcdrubay this other error is due to tags we have in our openupgradelib fork that confuse setuptools-scm.
I've removed them, please retry.

@jcdrubay
Copy link

jcdrubay commented Apr 4, 2022

It does not seem to fix the issue :/

Collecting git+https://github.com/acsone/openupgradelib.git@allow-install-without-setuptools (from -r /Users/??/??/code/projects/14/??/requirements_final.txt (line 71))
  Cloning https://github.com/acsone/openupgradelib.git (to revision allow-install-without-setuptools) to /private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-req-build-oq7klaxi
  Running command git clone --filter=blob:none --quiet https://github.com/acsone/openupgradelib.git /private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-req-build-oq7klaxi
  Running command git checkout -b allow-install-without-setuptools --track origin/allow-install-without-setuptools
  Switched to a new branch 'allow-install-without-setuptools'
  Branch 'allow-install-without-setuptools' set up to track remote branch 'allow-install-without-setuptools' from 'origin'.
  Resolved https://github.com/acsone/openupgradelib.git to commit b37ac83c50b572360582541aceaa0ff4abbd19b5
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      Traceback (most recent call last):
        File "/Users/??/.pyenv/versions/3.8.10/envs/??/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Users/??/.pyenv/versions/3.8.10/envs/??/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/??/.pyenv/versions/3.8.10/envs/??/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 29, in <module>
          setup(
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 109, in setup
          _setup_distribution = dist = klass(attrs)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 462, in __init__
          _Distribution.__init__(
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 293, in __init__
          self.finalize_options()
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 886, in finalize_options
          ep(self)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 907, in _finalize_setup_keywords
          ep.load()(self, ep.name, value)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/integration.py", line 75, in version_keyword
          _assign_version(dist, config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/integration.py", line 48, in _assign_version
          maybe_version = _get_version(config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 151, in _get_version
          parsed_version = _do_parse(config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 98, in _do_parse
          version = _version_from_entrypoints(config) or _version_from_entrypoints(
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/_entrypoints.py", line 37, in _version_from_entrypoints
          version: Optional[ScmVersion] = _call_entrypoint_fn(root, config, ep.load())
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/_entrypoints.py", line 13, in _call_entrypoint_fn
          return fn(root, config=config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/git.py", line 146, in parse
          return _git_parse_inner(
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/git.py", line 181, in _git_parse_inner
          return meta(
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/version.py", line 193, in meta
          parsed_version = _parse_tag(tag, preformatted, config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/version.py", line 174, in _parse_tag
          tag = tag_to_version(tag, config)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/setuptools_scm/version.py", line 80, in tag_to_version
          version = config.version_cls(version)
        File "/private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-build-env-wvwazv2i/normal/lib/python3.8/site-packages/packaging/version.py", line 266, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      packaging.version.InvalidVersion: Invalid version: '13.0-slg-03a92de27-openupgradelib'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@sbidoul
Copy link
Member Author

sbidoul commented Apr 4, 2022

That's because our weird tag reappeared. I've removed it again. It should work now. But anyway, people are not supposed to use this fork.

@jcdrubay
Copy link

jcdrubay commented Apr 4, 2022

Hi @sbidoul I confirm that it worked well this time:

Collecting git+https://github.com/acsone/openupgradelib.git@allow-install-without-setuptools (from -r /Users/jc/komit/code/projects/14/kodoo-14/requirements_final.txt (line 71))
  Cloning https://github.com/acsone/openupgradelib.git (to revision allow-install-without-setuptools) to /private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-req-build-tc315w58
  Running command git clone --filter=blob:none --quiet https://github.com/acsone/openupgradelib.git /private/var/folders/sj/mcq6_pw11flcfgzwm4fthr2c0000gn/T/pip-req-build-tc315w58
  Running command git checkout -b allow-install-without-setuptools --track origin/allow-install-without-setuptools
  Switched to a new branch 'allow-install-without-setuptools'
  Branch 'allow-install-without-setuptools' set up to track remote branch 'allow-install-without-setuptools' from 'origin'.
  Resolved https://github.com/acsone/openupgradelib.git to commit b37ac83c50b572360582541aceaa0ff4abbd19b5
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done

@alexenderthegreat
Copy link

alexenderthegreat commented Apr 20, 2022

Im sorry I have the same issues with the package :

Using cached pathlib-1.0.1.tar.gz (49 kB)

And the same issue appear :

Using cached pathlib-1.0.1.tar.gz (49 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
ERROR: Can not execute setup.py since setuptools is not available in the build environment.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

Im not sur of what weird tag you speak of and were to find and remove it
Thank you

there a copy of my power shell 👍

image

@legalsylvain
Copy link
Contributor

Need rebase and fix conflicts.

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

Successfully merging this pull request may close these issues.

Installation error: Can not execute setup.py since setuptools is not available in the build environment.
4 participants