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

feat: Add the project itself as an editable dependency #1084

Merged
merged 23 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cb6633b
Add the project itself as an editable dependency
olivier-lacroix Mar 29, 2024
5da2522
fix: some cleanup
tdejager Mar 29, 2024
e609029
Create intermediary pyproject reference
olivier-lacroix Mar 30, 2024
a02e995
Fix flask example
olivier-lacroix Mar 30, 2024
d2c688e
lint
olivier-lacroix Mar 30, 2024
e8e3766
Add doc
olivier-lacroix Mar 30, 2024
9884c7e
Make editable installation of the project itself explicit
olivier-lacroix Mar 31, 2024
1684f88
Get name from the pyproject.toml [project] table
olivier-lacroix Mar 31, 2024
99b19f5
Align example
olivier-lacroix Mar 31, 2024
b55e98b
Revert "Make editable installation of the project itself explicit"
olivier-lacroix Apr 2, 2024
c47f26d
Merge remote-tracking branch 'upstream/main' into selfeditable
olivier-lacroix Apr 2, 2024
4d0e482
Merge branch 'main' into selfeditable
tdejager Apr 2, 2024
633cc65
Revert "Revert "Make editable installation of the project itself expl…
olivier-lacroix Apr 2, 2024
35595fe
Inform about the addition of the package itself as an editable install
olivier-lacroix Apr 2, 2024
7bc4d83
Merge branch 'main' into selfeditable
olivier-lacroix Apr 2, 2024
22ffc49
Add a test testing proper self-install
olivier-lacroix Apr 2, 2024
1876661
Add more details about the build-system section
olivier-lacroix Apr 3, 2024
6c6aeb4
Add *.egg-info to the .gitignore
olivier-lacroix Apr 3, 2024
207763d
lint
olivier-lacroix Apr 3, 2024
7e0a424
Merge branch 'main' into selfeditable
olivier-lacroix Apr 3, 2024
2758c6d
fix: used `pixi.toml` instead of `pyproject.toml`
tdejager Apr 3, 2024
d0d72b6
Add platforms for CI/CD tests
olivier-lacroix Apr 3, 2024
12a0d58
Merge branch 'main' into selfeditable
olivier-lacroix Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions docs/advanced/pyproject_toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
```
This is the minimum requirement for pixi to understand and parse the project.

If you use `pixi init` in a folder that has a `pyproject.toml` file, pixi will automatically add the `[tool.pixi.project]` section to the file.
And will also add some defaults to the `.gitignore` and `.gitattributes` file.
However, it is recommended you use `pixi init` in a folder that has a `pyproject.toml` file. Pixi will automatically

- Add the above `[tool.pixi.project]` section to the file, auto-detecting your current platform;
- Add the current project as an editable pypi dependency;
- Add some defaults to the `.gitignore` and `.gitattributes` file.

## Python dependency
The `pyproject.toml` file supports the `requires_python` field.
Expand Down Expand Up @@ -144,11 +147,19 @@ test = ["test"]
```

## Build-system section
The `pyproject.toml` file normally contains a `[build-system]` section.
Currently, pixi does not use this section, but it is recommended to keep it in the file for compatibility with other tools.
The `pyproject.toml` file normally contains a `[build-system]` section. Pixi will use this section to build and install the project if it is added as a pypi path dependency.

If the `pyproject.toml` file does not contain any `[build-system]` section, pixi will fall back to [uv](https://github.com/astral-sh/uv)'s default, which is equivalent to the below:

```toml title="pyproject.toml"
[build-system]
requires = ["setuptools >= 40.8.0"]
build-backend = "setuptools.build_meta:__legacy__"
```
Including a `[build-system]` section is **highly recommended**. If you are not sure of the [build-backend](https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-build-backend) you want to use, including the `[build-system]` section below in your `pyproject.toml` is a good starting point

```toml title="pyproject.toml"
[build-system]
requires = ["setuptools", "wheel"]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
```
1 change: 1 addition & 0 deletions examples/flask-hello-world-pyproject/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.egg-info
tdejager marked this conversation as resolved.
Show resolved Hide resolved
243 changes: 227 additions & 16 deletions examples/flask-hello-world-pyproject/pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading