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

[Monorepo] index has to be set twice #2640

Closed
1 task done
BlechbiegerBender opened this issue Feb 19, 2024 · 1 comment
Closed
1 task done

[Monorepo] index has to be set twice #2640

BlechbiegerBender opened this issue Feb 19, 2024 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@BlechbiegerBender
Copy link

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

  1. Setup monorepo structure as in 🚀 Example repository
  2. Setup dependencies like described in pdm docu
    project/pyproject.toml:
[tool.pdm.dev-dependencies]
dev = [
    "-e file:///${PROJECT_ROOT}/packages/foo-core",
    "-e file:///${PROJECT_ROOT}/packages/foo-cli",
    "-e file:///${PROJECT_ROOT}/packages/foo-app",
]
  1. Add company index on repo root level
    project/pyproject.toml:
[[tool.pdm.source]]
name = "private"
url = <company-url>
verify_ssl = true
  1. Set up pdm.toml on top level to ignore pypi.org in order to be able to work on machines that are blocked from Internet access by a firewall
[pypi]
ignore_stored_index = true
  1. Build sub package:
pdm build -p .\packages\<subpackage> -v

Actual behavior

PDM fails to build package if index is only set in repo root pyproject.toml

pdm build -p .\packages\<subpackage> -v
Building sdist...
pdm.termui: Preparing environment(Isolated mode) for PEP 517 build...
pdm.termui: ======== Start resolving requirements ========
pdm.termui:   pdm-backend
pdm.termui:   python>=3.10.11,<3.10.12
pdm.termui:   Adding requirement pdm-backend
[PdmUsageError]: You must specify at least one index in pyproject.toml or config.
The 'pypi.ignore_stored_index' config value is True

If index is set in sub package packages\<subpackage>\pyproject.toml too, PDM successfully builds package.

Expected behavior

Maybe my expectation is not correct, but I would expect that the set index is used for sub packages as well.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:
  2.12.3
Python Interpreter:
  C:\git\pdm-example-monorepo\.venv\Scripts\python.exe (3.10)
Project Root:
  C:/git/pdm-example-monorepo
Local Packages:

{
  "implementation_name": "cpython",
  "implementation_version": "3.10.11",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.19045",
  "python_full_version": "3.10.11",
  "platform_python_implementation": "CPython",
  "python_version": "3.10",
  "sys_platform": "win32"
}
@BlechbiegerBender BlechbiegerBender added the 🐛 bug Something isn't working label Feb 19, 2024
@frostming
Copy link
Collaborator

Currently, there is no subordinate relationship between the root package and the sub packages, they are treated independently. The UI design relies on the support of workspace(#1505 )

@frostming frostming closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants