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

Layered requirements and pyproject.toml #1820

Closed
gchaperon opened this issue Mar 8, 2023 · 2 comments
Closed

Layered requirements and pyproject.toml #1820

gchaperon opened this issue Mar 8, 2023 · 2 comments
Labels
duplicate Duplicate of an existing issue/PR pyproject.toml Related to pyproject.toml support

Comments

@gchaperon
Copy link

gchaperon commented Mar 8, 2023

When trying to use layered requirements in pyproject.toml, pip-compile fails.

Using the following pyproject.toml file

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "not-in-pypi"
version = "0.1.0"
dependencies = [
    "click",
    "numpy",
    "scikit-learn",
]

[project.optional-dependencies]
test = ["pytest"]
dev = ["not-in-pypi[test]", "ipython"]

and running pip-compile -o dev-requirements.txt --extra dev pyproject.toml (same command as in the docs), pip-compile fails with

Could not find a version that matches not-in-pypi[test] (from not-in-pypi (pyproject.toml))
No versions found
Was https://pypi.org/simple reachable?

However trying to install the package with pip install .[dev] works perfectly fine.

I think this usage of optional dependencies is supported by pip, given this and this comments.

Environment Versions

  1. OS Type : linux
  2. Python version: Python 3.10.9
  3. pip version: pip 22.3.1 from /home/gchapero/projects/pip-tools-bug/env/lib/python3.10/site-packages/pip (python 3.10)
  4. pip-tools version: pip-compile, version 6.12.3

Steps to replicate

  1. Using the pyproject.toml file described above, run pip-compile --extra dev -o dev-requirements.txt pyproject.toml

Expected result

A dev-requirements.txt file.

Actual result

An error.

@atugushev
Copy link
Member

Duplicate of #1685.

@atugushev atugushev added duplicate Duplicate of an existing issue/PR pyproject.toml Related to pyproject.toml support labels Mar 8, 2023
@AndydeCleyre
Copy link
Contributor

Thanks for linking those comments, I had no idea listing a package as a dependency of itself might be a supported pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate of an existing issue/PR pyproject.toml Related to pyproject.toml support
Projects
None yet
Development

No branches or pull requests

3 participants