-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(cli): fallback to build-in poetry-core on build #10092
feat(cli): fallback to build-in poetry-core on build #10092
Conversation
Reviewer's Guide by SourceryThis pull request ensures that a build backend is defined in the pyproject.toml file when running Sequence diagram for poetry build command with build backend checksequenceDiagram
actor User
participant CLI
participant BuildCommand
participant PyProject
User->>CLI: poetry build
CLI->>BuildCommand: execute build
BuildCommand->>PyProject: check build-backend
alt No build backend defined
PyProject-->>BuildCommand: build-backend not found
BuildCommand-->>CLI: return error (1)
CLI-->>User: Show error message
else Build backend defined
PyProject-->>BuildCommand: build-backend found
BuildCommand->>BuildCommand: proceed with build
BuildCommand-->>CLI: return success (0)
CLI-->>User: Build completed
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c1ce753
to
5634612
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @finswimmer - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please update the documentation to explain this new validation check and behavior change, since this changes how Poetry handles projects without a build-system defined.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
5634612
to
626abfc
Compare
@sourcery-ai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @finswimmer - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please update the documentation to describe this new validation check for build backend configuration. This is a user-facing change that should be documented.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/poetry/console/commands/build.py
Outdated
def build(self, options: BuildOptions) -> int: | ||
if not self.poetry.is_package_mode: | ||
self.io.write_error_line( | ||
"Building a package is not possible in non-package mode." | ||
) | ||
return 1 | ||
|
||
if not self._has_build_backend_defined(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider making the error message more specific about whether the build-system section is missing or just the build-backend key
This would help users identify and fix configuration issues more quickly.
Suggested implementation:
def _get_build_system_status(self) -> tuple[bool, bool]:
pyproject_data = self.poetry.file.read()
has_build_system = "build-system" in pyproject_data
has_build_backend = "build-backend" in pyproject_data.get("build-system", {})
return has_build_system, has_build_backend
has_build_system, has_build_backend = self._get_build_system_status()
if not has_build_system:
self.io.write_error_line(
"Missing [build-system] section in pyproject.toml. Please add this section with a build-backend."
)
return 1
if not has_build_backend:
self.io.write_error_line(
"Missing build-backend key in [build-system] section. Please define one in pyproject.toml."
)
src/poetry/console/commands/build.py
Outdated
@@ -114,13 +114,22 @@ def _get_builder(self) -> Callable[..., None]: | |||
|
|||
return self._build | |||
|
|||
def _has_build_backend_defined(self) -> bool: | |||
return "build-backend" in self.poetry.file.read().get("build-system", {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to move this to be something like self.poetry.pytpoject.build_system.is_fallback
.
But that will need an additional property in https://github.com/python-poetry/poetry-core/blob/d97577e664d59173482a78f70e8f743cc5468851/src/poetry/core/pyproject/tables.py#L12
But for now something like this should work.
return "build-backend" in self.poetry.file.read().get("build-system", {}) | |
return "build-backend" in self.poetry.pyproject.data.get("build-system", {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I wasn't aware of the data
attribute of pyproject
👍
I thought about a flag as well. But I don't wanted to change poetry-core
before. And we would pollute again poetry-core
with something we only need in poetry
. Actually we only need it for poetry build
.
src/poetry/console/commands/build.py
Outdated
def build(self, options: BuildOptions) -> int: | ||
if not self.poetry.is_package_mode: | ||
self.io.write_error_line( | ||
"Building a package is not possible in non-package mode." | ||
) | ||
return 1 | ||
|
||
if not self._has_build_backend_defined(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this also be a surprise to users as this breaks previous behavior in the same way setuptools are being used? Not sure how many people leave out the section intentionally.
That said, I'd also say that the current use of setuptools is in accordance with PEP518.
Tools should not require the existence of the [build-system] table. A pyproject.toml file may be used to store configuration details other than build-related data and thus lack a [build-system] table legitimately. If the file exists but is lacking the [build-system] table then the default values as specified above should be used. If the table is specified but is missing required fields then the tool should consider it an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this also be a surprise to users as this breaks previous behavior in the same way setuptools are being used?
It will surprise people for sure. But now they get an error message. Without it poetry build
would build a package, but it won't contain the data people expect. So "fail fast" is a better surprise ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is, how do you determine if they intended to use setuptools by relying on PEP518 default?
It is not unreasonable to imagine that Poetry is used for dev but the package needs setuptools for build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is an edge enough case that it might be okay to enforce a build-system definition.
626abfc
to
46f3513
Compare
it's not only "fine" - it's what PEP517 says tools should do.
only results in a broken package if the pyproject.toml is not understood by setuptools, presumably? In the new PEP621 world that is not going to be a problem. Perhaps a warning would make sense, but I suggest that erroring out where the specs say tools should not error out is overshooting. |
In the PEP 621 world, yes. But if the project doesn't (fully) use the As an alternative we could trigger a non-isolated build if no build-backend is given and (optional) show a warning that it would be good idea to add one to the |
Allowing the build to continue into isolated with a warning is safe enough, I reckon. Let's not add more logic unless we need it. That said I can already see the issues titled "why is poetry using setuptools" etc. |
I am in favor of being backward compatible to the point of using It will be far more common that people have no backend defined and still used poetry build than that people that have no backend defined will be wondering that |
I am okay with defaulting to Although I was looking forward to just being able to build arbitrary setuptool projects (which a lot of times do not have the |
46f3513
to
1f08e99
Compare
1f08e99
to
e9e227d
Compare
@sourcery-ai review |
I think this is a wrong direction, the specs are explicit about what the behaviour should be in case there is no backend defined. It is not "fall back to poetry-core", and it is not "report an error". It is "use Anyway you will want to have an answer ready for when folk turn up complaining that poetry is not behaving as it is supposed to. |
eg |
e9e227d
to
5f134b9
Compare
This was always the case until now, because It's arguable to not throw in error in the future, if no build-system is given and instead use |
this is not correct, I think there are two cases and we are perhaps talking slightly past one another In the case of a In the case of a PEP-621 variant In the In the PEP-621 case I really think that there is not a good argument for falling back to |
I think there is one (and probably the only) good argument: backwards compatibility. As of now (no matter if PEP 621 or not) all released versions do use In my opinion, it still makes sense to default to I do not think that it is that important to be compatible with projects that do not define a build-backend (and expect |
Sure - we can go further - if you manage a project with anything at all, you should define a build backend. So far as I know no-one thinks that omitting a build backend is the right thing to do, even the PEP517 stuff about how to handle that is (as I understand it) really aimed at projects that have not yet added a build backend. The question is whether we are justified in overruling the specs and choosing a different fallback than we "should". Defaulting to poetry-core clearly made sense pre-PE517 and pre-PEP621. If nothing else: poetry was here first, and it is hardly poetry's fault if the specs retrospectively asked it to do something else. But anyway the poetry-core default made sense where there was no reasonable expectation of successfully building a poetry project except with poetry-core; and where there was definitely no hope of using poetry to build a project that used another backend. It wasn't really even a default: it was just "always use poetry-core". But the world has moved on:
IMO those changes really both drive big holes through "default to poetry-core": it is time to get in line with the standards. (I think I've said my piece - possibly too many times, sorry! - and will leave it there) |
I agree with
And that is my vote for now. We do a hard deprecation.
|
5f134b9
to
ec51461
Compare
ec51461
to
a6fa788
Compare
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [poetry](https://github.com/python-poetry/poetry) ([changelog](https://python-poetry.org/history/)) | major | `1.8.5` -> `2.1.0` | --- ### Release Notes <details> <summary>python-poetry/poetry (poetry)</summary> ### [`v2.1.0`](https://github.com/python-poetry/poetry/blob/HEAD/CHANGELOG.md#210---2025-02-15) [Compare Source](python-poetry/poetry@2.0.1...2.1.0) ##### Added - **Make `build` command build-system agnostic** ([#​10059](python-poetry/poetry#10059), [#​10092](python-poetry/poetry#10092)). - Add a `--config-settings` option to `poetry build` ([#​10059](python-poetry/poetry#10059)). - Add support for defining `config-settings` when building dependencies ([#​10129](python-poetry/poetry#10129)). - **Add (experimental) commands to manage Python installations** ([#​10112](python-poetry/poetry#10112)). - Use `findpython` to find the Python interpreters ([#​10097](python-poetry/poetry#10097)). - Add a `--no-truncate` option to `poetry show` ([#​9580](python-poetry/poetry#9580)). - Re-add support for passwords with empty usernames ([#​10088](python-poetry/poetry#10088)). - Add better error messages ([#​10053](python-poetry/poetry#10053), [#​10065](python-poetry/poetry#10065), [#​10126](python-poetry/poetry#10126), [#​10127](python-poetry/poetry#10127), [#​10132](python-poetry/poetry#10132)). ##### Changed - **`poetry new` defaults to "src" layout by default** ([#​10135](python-poetry/poetry#10135)). - Improve performance of locking dependencies ([#​10111](python-poetry/poetry#10111), [#​10114](python-poetry/poetry#10114), [#​10138](python-poetry/poetry#10138), [#​10146](python-poetry/poetry#10146)). - Deprecate adding sources without specifying `--priority` ([#​10134](python-poetry/poetry#10134)). ##### Fixed - Fix an issue where global options were not handled correctly when positioned after command options ([#​10021](python-poetry/poetry#10021), [#​10067](python-poetry/poetry#10067), [#​10128](python-poetry/poetry#10128)). - Fix an issue where building a dependency from source failed because of a conflict between build-system dependencies that were not required for the target environment ([#​10048](python-poetry/poetry#10048)). - Fix an issue where `poetry init` was not able to find a package on PyPI while adding dependencies interactively ([#​10055](python-poetry/poetry#10055)). - Fix an issue where the `@latest` descriptor was incorrectly passed to the core requirement parser ([#​10069](python-poetry/poetry#10069)). - Fix an issue where Boolean environment variables set to `True` (in contrast to `true`) were interpreted as `false` ([#​10080](python-poetry/poetry#10080)). - Fix an issue where `poetry env activate` reported a misleading error message ([#​10087](python-poetry/poetry#10087)). - Fix an issue where adding an optional dependency with `poetry add --optional` would not correctly update the lock file ([#​10076](python-poetry/poetry#10076)). - Fix an issue where `pip` was not installed/updated before other dependencies resulting in a race condition ([#​10102](python-poetry/poetry#10102)). - Fix an issue where Poetry freezes when multiple threads attempt to unlock the `keyring` simultaneously ([#​10062](python-poetry/poetry#10062)). - Fix an issue where markers with extras were not locked correctly ([#​10119](python-poetry/poetry#10119)). - Fix an issue where self-referential extras were not resolved correctly ([#​10106](python-poetry/poetry#10106)). - Fix an issue where Poetry could not be run from a `zipapp` ([#​10074](python-poetry/poetry#10074)). - Fix an issue where installation failed with a permission error when using the system environment as a user without write access to system site packages ([#​9014](python-poetry/poetry#9014)). - Fix an issue where a version of a dependency that is not compatible with the project's python constraint was locked. ([#​10141](python-poetry/poetry#10141)). - Fix an issue where Poetry wrongly reported that the current project's supported Python range is not compatible with some of the required packages Python requirement ([#​10157](python-poetry/poetry#10157)). - Fix an issue where the requested extras of a dependency were ignored if the same dependency (with same extras) was specified in multiple groups ([#​10158](python-poetry/poetry#10158)). ##### Docs - Sort commands by name in the CLI reference ([#​10035](python-poetry/poetry#10035)). - Add missing documentation for `env` commands ([#​10027](python-poetry/poetry#10027)). - Clarify that the `name` and `version` fields are always required if the `project` section is specified ([#​10033](python-poetry/poetry#10033)). - Add a note about restarting the shell for tab completion changes to take effect ([#​10070](python-poetry/poetry#10070)). - Fix the example for `project.gui-scripts` [#​10121](python-poetry/poetry#10121). - Explain how to include files as scripts in the project configuration ([#​9572](python-poetry/poetry#9572), [#​10133](python-poetry/poetry#10133)). - Add additional information on specifying required python versions ([#​10104](python-poetry/poetry#10104)). ##### poetry-core ([`2.1.0`](https://github.com/python-poetry/poetry-core/releases/tag/2.1.0)) - Fix an issue where inclusive ordering with post releases was inconsistent with PEP 440 ([#​379](python-poetry/poetry-core#379)). - Fix an issue where invalid URI tokens in PEP 508 requirement strings were silently discarded ([#​817](python-poetry/poetry-core#817)). - Fix an issue where wrong markers were calculated when removing parts covered by the project's python constraint ([#​824](python-poetry/poetry-core#824)). - Fix an issue where optional dependencies that are not part of an extra were included in the wheel metadata ([#​830](python-poetry/poetry-core#830)). - Fix an issue where the `__pycache__` directory and `*.pyc` files were included in sdists and wheels ([#​835](python-poetry/poetry-core#835)). ### [`v2.0.1`](https://github.com/python-poetry/poetry/blob/HEAD/CHANGELOG.md#201---2025-01-11) [Compare Source](python-poetry/poetry@2.0.0...2.0.1) ##### Added - Add support for `poetry search` in legacy sources ([#​9949](python-poetry/poetry#9949)). - Add a message in the `poetry source show` output when PyPI is implicitly enabled ([#​9974](python-poetry/poetry#9974)). ##### Changed - Improve performance for merging markers from overrides at the end of dependency resolution ([#​10018](python-poetry/poetry#10018)). ##### Fixed - Fix an issue where `poetry sync` did not remove packages that were not requested ([#​9946](python-poetry/poetry#9946)). - Fix an issue where `poetry check` failed even though there were just warnings and add a `--strict` option to fail on warnings ([#​9983](python-poetry/poetry#9983)). - Fix an issue where `poetry update`, `poetry add` and `poetry remove` with `--only` uninstalled packages from other groups ([#​10014](python-poetry/poetry#10014)). - Fix an issue where `poetry update`, `poetry add` and `poetry remove` uninstalled all extra packages ([#​10016](python-poetry/poetry#10016)). - Fix an issue where `poetry self update` did not recognize Poetry's own environment ([#​9995](python-poetry/poetry#9995)). - Fix an issue where read-only system site-packages were not considered when loading an environment with system site-packages ([#​9942](python-poetry/poetry#9942)). - Fix an issue where an error message in `poetry install` started with `Warning:` instead of `Error:` ([#​9945](python-poetry/poetry#9945)). - Fix an issue where `Command.set_poetry`, which is used by plugins, was removed ([#​9981](python-poetry/poetry#9981)). - Fix an issue where the help text of `poetry build --clean` showed a malformed short option instead of the description ([#​9994](python-poetry/poetry#9994)). ##### Docs - Add a FAQ entry for the migration from Poetry-specific fields to the `project` section ([#​9996](python-poetry/poetry#9996)). - Fix examples for `project.readme` and `project.urls` ([#​9948](python-poetry/poetry#9948)). - Add a warning that package sources are a Poetry-specific feature that is not included in core metadata ([#​9935](python-poetry/poetry#9935)). - Replace `poetry install --sync` with `poetry sync` in the section about synchronizing dependencies ([#​9944](python-poetry/poetry#9944)). - Replace `poetry shell` with `poetry env activate` in the basic usage section ([#​9963](python-poetry/poetry#9963)). - Mention that `project.name` is always required when the `project` section is used ([#​9989](python-poetry/poetry#9989)). - Fix the constraint of `poetry-plugin-export` in the section about `poetry export` ([#​9954](python-poetry/poetry#9954)). ##### poetry-core ([`2.0.1`](https://github.com/python-poetry/poetry-core/releases/tag/2.0.1)) - Replace the deprecated core metadata field `Home-page` with `Project-URL: Homepage` ([#​807](python-poetry/poetry-core#807)). - Fix an issue where includes from `tool.poetry.packages` without a specified `format` were not initialized with the default value resulting in a `KeyError` ([#​805](python-poetry/poetry-core#805)). - Fix an issue where some `project.urls` entries were not processed correctly resulting in a `KeyError` ([#​807](python-poetry/poetry-core#807)). - Fix an issue where dynamic `project.dependencies` via `tool.poetry.dependencies` were ignored if `project.optional-dependencies` were defined ([#​811](python-poetry/poetry-core#811)). ### [`v2.0.0`](https://github.com/python-poetry/poetry/blob/HEAD/CHANGELOG.md#200---2025-01-05) [Compare Source](python-poetry/poetry@1.8.5...2.0.0) ##### Added - **Add support for the `project` section in the `pyproject.toml` file according to PEP 621** ([#​9135](python-poetry/poetry#9135), [#​9917](python-poetry/poetry#9917)). - **Add support for defining Poetry plugins that are required by the project and automatically installed if not present** ([#​9547](python-poetry/poetry#9547)). - **Lock resulting markers and groups and add a `installer.re-resolve` option (default: `true`) to allow installation without re-resolving** ([#​9427](python-poetry/poetry#9427)). - Add a `--local-version` option to `poetry build` ([#​9064](python-poetry/poetry#9064)). - Add a `--clean` option to `poetry build` ([#​9067](python-poetry/poetry#9067)). - Add FIPS support for `poetry publish` ([#​9101](python-poetry/poetry#9101)). - Add the option to use `poetry new` interactively and configure more fields ([#​9101](python-poetry/poetry#9101)). - Add a config option `installer.only-binary` to enforce the use of binary distribution formats ([#​9150](python-poetry/poetry#9150)). - Add backend support for legacy repository search ([#​9132](python-poetry/poetry#9132)). - Add support to resume downloads from connection resets ([#​9422](python-poetry/poetry#9422)). - Add the option to define a constraint for the required Poetry version to manage the project ([#​9547](python-poetry/poetry#9547)). - Add an `--all-groups` option to `poetry install` ([#​9744](python-poetry/poetry#9744)). - Add an `poetry env activate` command as replacement of `poetry shell` ([#​9763](python-poetry/poetry#9763)). - Add a `--markers` option to `poetry add` to add a dependency with markers ([#​9814](python-poetry/poetry#9814)). - Add a `--migrate` option to `poetry config` to migrate outdated configs ([#​9830](python-poetry/poetry#9830)). - Add a `--project` option to search the `pyproject.toml` file in another directory without switching the directory ([#​9831](python-poetry/poetry#9831)). - Add support for shortened hashes to define git dependencies ([#​9748](python-poetry/poetry#9748)). - Add partial support for conflicting extras ([#​9553](python-poetry/poetry#9553)). - Add a `poetry sync` command as replacement of `poetry install --sync` ([#​9801](python-poetry/poetry#9801)). ##### Changed - **Change the default behavior of `poetry lock` to `--no-update` and introduce a `--regenerate` option for the old default behavior** ([#​9327](python-poetry/poetry#9327)). - **Remove the dependency on `poetry-plugin-export` so that `poetry export` is not included per default** ([#​5980](python-poetry/poetry#5980)). - **Outsource `poetry shell` into `poetry-plugin-shell`** ([#​9763](python-poetry/poetry#9763)). - **Change the interface of `poetry add --optional` to require an extra the optional dependency is added to** ([#​9135](python-poetry/poetry#9135)). - **Actually switch the directory when using `--directory`/`-C`** ([#​9831](python-poetry/poetry#9831)). - **Drop support for Python 3.8** ([#​9692](python-poetry/poetry#9692)). - Rename `experimental.system-git-client` to `experimental.system-git` ([#​9787](python-poetry/poetry#9787), [#​9795](python-poetry/poetry#9795)). - Replace `virtualenvs.prefer-active-python` by the inverse setting `virtualenvs.use-poetry-python` and prefer the active Python by default ([#​9786](python-poetry/poetry#9786)). - Deprecate several fields in the `tool.poetry` section in favor of the respective fields in the `project` section in the `pyproject.toml` file ([#​9135](python-poetry/poetry#9135)). - Deprecate `poetry install --sync` in favor of `poetry sync` ([#​9801](python-poetry/poetry#9801)). - Upgrade the warning if the current project cannot be installed to an error ([#​9333](python-poetry/poetry#9333)). - Remove special handling for `platformdirs 2.0` macOS config directory ([#​8916](python-poetry/poetry#8916)). - Tweak PEP 517 builds ([#​9094](python-poetry/poetry#9094)). - Use Poetry instead of pip to manage dependencies in isolated build environments ([#​9168](python-poetry/poetry#9168), [#​9227](python-poetry/poetry#9227)). - Trust empty `Requires-Dist` with modern metadata ([#​9078](python-poetry/poetry#9078)). - Do PEP 517 builds instead of parsing `setup.py` to determine dependencies ([#​9099](python-poetry/poetry#9099)). - Drop support for reading lock files prior version 1.0 (created with Poetry prior 1.1) ([#​9345](python-poetry/poetry#9345)). - Default to `>=` instead of `^` for the Python requirement when initializing a new project ([#​9558](python-poetry/poetry#9558)). - Limit `build-system` to the current major version of `poetry-core` when initializing a new project ([#​9812](python-poetry/poetry#9812)). - Remove pip-based installation, i.e. `installer.modern-installation = false` ([#​9392](python-poetry/poetry#9392)). - Remove `virtualenvs.options.no-setuptools` config option and never include `setuptools` per default ([#​9331](python-poetry/poetry#9331)). - Rename exceptions to have an `Error` suffix ([#​9705](python-poetry/poetry#9705)). - Remove deprecated CLI options and methods and revoke the deprecation of `--dev` ([#​9732](python-poetry/poetry#9732)). - Ignore installed packages during dependency resolution ([#​9851](python-poetry/poetry#9851)). - Improve the error message on upload failure ([#​9701](python-poetry/poetry#9701)). - Improve the error message if the current project cannot be installed to include another root cause ([#​9651](python-poetry/poetry#9651)). - Improve the output of `poetry show <package>` ([#​9750](python-poetry/poetry#9750)). - Improve the error message for build errors ([#​9870](python-poetry/poetry#9870)). - Improve the error message when trying to remove a package from a project without any dependencies ([#​9918](python-poetry/poetry#9918)). - Drop the direct dependency on `crashtest` ([#​9108](python-poetry/poetry#9108)). - Require `keyring>=23.3.1` ([#​9167](python-poetry/poetry#9167)). - Require `build>=1.2.1` ([#​9283](python-poetry/poetry#9283)). - Require `dulwich>=0.22.6` ([#​9748](python-poetry/poetry#9748)). ##### Fixed - Fix an issue where git dependencies with extras could only be cloned if a branch was specified explicitly ([#​7028](python-poetry/poetry#7028)). - Fix an issue where `poetry env remove` failed if `virtualenvs.in-project` was set to `true` ([#​9118](python-poetry/poetry#9118)). - Fix an issue where locking packages with a digit at the end of the name and non-standard sdist names failed ([#​9189](python-poetry/poetry#9189)). - Fix an issue where credentials where not passed when trying to download an URL dependency ([#​9202](python-poetry/poetry#9202)). - Fix an issue where using uncommon group names with `poetry add` resulted in a broken `pyproject.toml` ([#​9277](python-poetry/poetry#9277)). - Fix an issue where an inconsistent entry regarding the patch version of Python was kept in `envs.toml` ([#​9286](python-poetry/poetry#9286)). - Fix an issue where relative paths were not resolved properly when using `poetry build --directory` ([#​9433](python-poetry/poetry#9433)). - Fix an issue where unrequested extras were not uninstalled when running `poetry install` without an existing lock file ([#​9345](python-poetry/poetry#9345)). - Fix an issue where the `poetry-check` pre-commit hook did not trigger if only `poetry.lock` has changed ([#​9504](python-poetry/poetry#9504)). - Fix an issue where files (rather than directories) could not be added as single page source ([#​9166](python-poetry/poetry#9166)). - Fix an issue where invalid constraints were generated when adding a package with a local version specifier ([#​9603](python-poetry/poetry#9603)). - Fix several encoding warnings ([#​8893](python-poetry/poetry#8893)). - Fix an issue where `virtualenvs.prefer-active-python` was not respected ([#​9278](python-poetry/poetry#9278)). - Fix an issue where the line endings of the lock file were changed ([#​9468](python-poetry/poetry#9468)). - Fix an issue where installing multiple dependencies from the same git repository failed sporadically due to a race condition ([#​9658](python-poetry/poetry#9658)). - Fix an issue where installing multiple dependencies from forked monorepos failed sporadically due to a race condition ([#​9723](python-poetry/poetry#9723)). - Fix an issue where an extra package was not installed if it is required by multiple extras ([#​9700](python-poetry/poetry#9700)). - Fix an issue where a `direct_url.json` with vcs URLs not compliant with PEP 610 was written ([#​9007](python-poetry/poetry#9007)). - Fix an issue where other files than wheels were recognized as wheels ([#​9770](python-poetry/poetry#9770)). - Fix an issue where `installer.max-workers` was ignored for the implicit PyPI source ([#​9815](python-poetry/poetry#9815)). - Fix an issue where local settings (from `poetry.toml`) were ignored for the implicit PyPI source ([#​9816](python-poetry/poetry#9816)). - Fix an issue where different `dulwich` versions resulted in different hashes for a git dependency from a tag ([#​9849](python-poetry/poetry#9849)). - Fix an issue where installing a yanked package with no dependencies failed with an `IndexError` ([#​9505](python-poetry/poetry#9505)). - Fix an issue where a package could not be added from a source that required an empty password ([#​9850](python-poetry/poetry#9850)). - Fix an issue where setting `allow-prereleases = false` still allowed pre-releases if no other solution was found ([#​9798](python-poetry/poetry#9798)). - Fix an issue where the wrong environment was used for checking if an installed package is from system site packages ([#​9861](python-poetry/poetry#9861)). - Fix an issue where build errors from builds to retrieve metadata information were hidden ([#​9870](python-poetry/poetry#9870)). - Fix an issue where `poetry check` falsely reported that an invalid source "pypi" is referenced in dependencies ([#​9475](python-poetry/poetry#9475)). - Fix an issue where `poetry install --sync` tried to uninstall system site packages if the virtual environment was created with `virtualenvs.options.system-site-packages = true` ([#​9863](python-poetry/poetry#9863)). - Fix an issue where HTTP streaming requests were not closed properly when not completely consumed ([#​9899](python-poetry/poetry#9899)). ##### Docs - Add information about getting test coverage in the contribution guide ([#​9726](python-poetry/poetry#9726)). - Mention `pre-commit-update` as an alternative to `pre-commit autoupdate` ([#​9716](python-poetry/poetry#9716)). - Improve the explanation of `exclude` and `include` ([#​9734](python-poetry/poetry#9734)). - Add information about compatible release requirements, i.e. `~=` ([#​9783](python-poetry/poetry#9783)). - Add documentation for using a build script to build extension modules ([#​9864](python-poetry/poetry#9864)). ##### poetry-core ([`2.0.0`](https://github.com/python-poetry/poetry-core/releases/tag/2.0.0)) - Add support for non PEP440 compliant version in the `platform_release` marker ([#​722](python-poetry/poetry-core#722)). - Add support for string comparisons with `in` / `not in` in generic constraints ([#​722](python-poetry/poetry-core#722)). - Add support for script files that are generated by a build script ([#​710](python-poetry/poetry-core#710)). - Add support for `SOURCE_DATE_EPOCH` when building packages ([#​766](python-poetry/poetry-core#766), [#​781](python-poetry/poetry-core#781)). - Create `METADATA` files with version 2.3 instead of 2.2 ([#​707](python-poetry/poetry-core#707)). - Remove support for `x` in version constraints ([#​770](python-poetry/poetry-core#770)). - Remove support for scripts with extras ([#​708](python-poetry/poetry-core#708)). - Remove deprecated features and interfaces ([#​702](python-poetry/poetry-core#702), [#​769](python-poetry/poetry-core#769)). - Deprecate `tool.poetry.dev-dependencies` in favor of `tool.poetry.group.dev.dependencies` ([#​754](python-poetry/poetry-core#754)). - Fix an issue where the `platlib` directory of the wrong Python was used ([#​726](python-poetry/poetry-core#726)). - Fix an issue where building a wheel in a nested output directory results in an error ([#​762](python-poetry/poetry-core#762)). - Fix an issue where `+` was not allowed in git URL paths ([#​765](python-poetry/poetry-core#765)). - Fix an issue where the temporary directory was not cleaned up on error ([#​775](python-poetry/poetry-core#775)). - Fix an issue where the regular expression for author names was too restrictive ([#​517](python-poetry/poetry-core#517)). - Fix an issue where basic auth http(s) credentials could not be parsed ([#​791](python-poetry/poetry-core#791)). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44Ni4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTY0LjEiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Reviewed-on: https://git.walbeck.it/walbeck-it/docker-python-poetry/pulls/1319 Co-authored-by: renovate-bot <[email protected]> Co-committed-by: renovate-bot <[email protected]>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
When we cannot find a
[build-system]
section or abuild-backend
within this section in apyproject.toml
we assumesetuptools
as the build backend This is fine according to PEP 517.While this approach is valid for dependencies it would be surprising on
poetry build
, now that an isolated build happens if the build-system is notpoetry-core
.Before #10059
poetry build
had created the package even if no build backend was defined in thepyproject.toml
. Now it would fallback tosetuptools
which would results in a broken package.This PR checks if a there is a
[build-system]
section and has abuild-backend
defined in the pyproject.toml and will use the build-inpoetry-core
if none is define. In addition a warning is presented to the user to fix it.Summary by Sourcery
Tests:
Summary by Sourcery
Tests:
pyproject.toml
file.