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: pypi source dependencies #985

Merged
merged 37 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
747dbb8
wip: pypi source deps
tdejager Mar 12, 2024
183dbc8
wip: accept file based dependencies
tdejager Mar 14, 2024
e45ef25
feat: added code path for resolving git branches
tdejager Mar 14, 2024
ae42579
Merge branch 'main' into feat/pypi-source-dependencies
tdejager Mar 15, 2024
b165d67
feat: refactoring satifisfyability
tdejager Mar 15, 2024
ab1db79
feat: only supporting `rev` for now
tdejager Mar 15, 2024
f52a978
feat: made the installation logic for source dependencies
tdejager Mar 18, 2024
f4df340
Merge branch 'main' into feat/pypi-source-dependencies
tdejager Mar 18, 2024
3c68475
feat: added freshness logic for file and archive sources
tdejager Mar 19, 2024
4cad656
feat: clean-up of functions
tdejager Mar 19, 2024
15df9dc
fix: limit the number of concurrent solves
tdejager Mar 19, 2024
f360290
feat: only limit concurrency when using pypi source dependencies
tdejager Mar 19, 2024
9ee7bd7
feat: added hello task
tdejager Mar 19, 2024
8f26962
Update examples/pypi-source-deps/pixi.toml
tdejager Mar 21, 2024
fd7f1b6
feat: added __version__ check to minimal project
tdejager Mar 21, 2024
ea57f91
feat: add writing of path based dependencies to lock file format
baszalmstra Mar 21, 2024
a658734
feat: changed project name
tdejager Mar 21, 2024
b387759
feat: change the task code back to original
tdejager Mar 21, 2024
980b2e3
Merge branch 'main' into feat/pypi-source-dependencies
tdejager Mar 21, 2024
b11cd64
fix: changed to exception
tdejager Mar 21, 2024
b0aac04
feat: model.py to incorporate git changes
tdejager Mar 21, 2024
28a0753
feat: updated schema
tdejager Mar 21, 2024
fd770f6
feat: canonicalize paths correctly
tdejager Mar 21, 2024
ec48db5
feat: update schema for direct dependencies
nichmor Mar 21, 2024
5b9620f
Merge branch 'feat/pypi-source-dependencies' of https://github.com/td…
nichmor Mar 21, 2024
917f626
Merge branch 'main' into feat/pypi-source-dependencies
baszalmstra Mar 21, 2024
eb98d02
Merge branch 'main' into feat/pypi-source-dependencies
tdejager Mar 21, 2024
e0860a1
chore: update uv to latest
wolfv Mar 22, 2024
1c628a1
fix tests and pre-commit
wolfv Mar 22, 2024
9276ce3
fix: update rattler version
tdejager Mar 22, 2024
f3d8347
feat: updated rattler to latest released versions
tdejager Mar 22, 2024
c9090fe
Update examples/pypi-source-deps/pixi.toml
tdejager Mar 22, 2024
c536f1a
Merge remote-tracking branch 'mine/update-uv' into feat/pypi-source-d…
wolfv Mar 22, 2024
341d089
merge uv update
wolfv Mar 22, 2024
d1de709
bump to rust 1.76 and apply all clippy fixes
wolfv Mar 22, 2024
0ee497f
try to fix the failure with a little sleepy
wolfv Mar 22, 2024
a9cbc5f
remove unused and likely broken code
wolfv Mar 22, 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
2 changes: 2 additions & 0 deletions examples/pypi-source-deps/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML
2 changes: 2 additions & 0 deletions examples/pypi-source-deps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# pixi environments
.pixi
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hello():
print('Hello World!')
8 changes: 8 additions & 0 deletions examples/pypi-source-deps/minimal_project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "minimal_project"
version = "0.1"
description = "just says hello"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
1,036 changes: 1,036 additions & 0 deletions examples/pypi-source-deps/pixi.lock

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions examples/pypi-source-deps/pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[project]
name = "pypi-source-deps"
version = "0.1.0"
description = "Add a short description here"
authors = ["Tim de Jager <[email protected]>"]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]

[tasks]
hello = "python -c 'from minimal_project import module;module.hello()'"
tdejager marked this conversation as resolved.
Show resolved Hide resolved

[dependencies]
python = "*"

[pypi-dependencies]

rich = "~=13.7"
# Lets start with some git dependencies
# With ssh
flask = { git = "ssh://[email protected]/pallets/flask" }
# With https
requests = { git = "https://github.com/psf/requests.git", rev = "0106aced5faa299e6ede89d1230bd6784f2c3660" }
# ...or use branch = '' to specify a branch or commit
tdejager marked this conversation as resolved.
Show resolved Hide resolved

# You can also directly add a source dependency from file
minimal_project = { path = "./minimal_project" }
tdejager marked this conversation as resolved.
Show resolved Hide resolved

# You can also use a direct url, to either a `.tar.gz` or `.zip`, or a `.whl` file
click = { url = "https://github.com/pallets/click/releases/download/8.1.7/click-8.1.7-py3-none-any.whl" }
31 changes: 24 additions & 7 deletions schema/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
BaseModel,
Field,
PositiveFloat,
conint,
constr,
StringConstraints,
)

NonEmptyStr = constr(min_length=1)
PathNoBackslash = constr(pattern=r"^[^\\]+$")
NonEmptyStr = Annotated[str, StringConstraints(min_length=1)]
PathNoBackslash = Annotated[str, StringConstraints(pattern=r"^[^\\]+$")]
Glob = NonEmptyStr
UnsignedInt = conint(ge=0)
GitUrl = constr(pattern=r"((git|ssh|http(s)?)|(git@[\w\.]+))(:(\/\/)?)([\w\.@:\/\\-~]+)")
UnsignedInt = Annotated[int, Field(strict=True, ge=0)]
GitUrl = Annotated[str, StringConstraints(pattern=r"((git|ssh|http(s)?)|(git@[\w\.]+))(:(\/\/)?)([\w\.@:\/\\-~]+)")]


class StrictBaseModel(BaseModel):
Expand Down Expand Up @@ -90,6 +89,24 @@ class MatchspecTable(StrictBaseModel):
CondaPackageName = NonEmptyStr


# { version = "sdfds" extras = ["sdf"] }
# { git = "sfds", rev = "fssd" }
# { path = "asfdsf" }
# { url = "asdfs" }

class PyPIVersionRequirement(StrictBaseModel):
version: NonEmptyStr = Field(
None,
description="The version of the package in [PEP 440](https://www.python.org/dev/peps/pep-0440/) format",
)

class PyPIGitRequirement(StrictBaseModel):
git: NonEmptyStr = Field(
None,
description="The git url to the repo e.g https://github.com/prefix-dev/pixi",
)
rev: NonEmptyStr | None = Field(None, description="The git sha revision")

class PyPIRequirementTable(StrictBaseModel):
version: NonEmptyStr | None = Field(
None,
Expand Down Expand Up @@ -286,4 +303,4 @@ class BaseManifest(StrictBaseModel):


if __name__ == "__main__":
print(json.dumps(BaseManifest.schema(), indent=2))
print(json.dumps(BaseManifest.model_json_schema(), indent=2))
Loading
Loading