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

Bump rattler for new lockfile support, fail on pypi packages #22

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

PaulKMueller
Copy link
Collaborator

Motivation

pixi has introduced the version 6 for pixi.lock files.
The APIs for this version are slightly different.

Changes

This PR updates both rattler_conda_types and rattler_lock to the newer version capable of handling version 6 lockfiles.

@PaulKMueller PaulKMueller requested a review from pavelzw as a code owner December 3, 2024 09:20
@pavelzw
Copy link
Member

pavelzw commented Dec 3, 2024

see #21

@PaulKMueller PaulKMueller requested a review from pavelzw December 3, 2024 12:35
src/pixi_lock.rs Outdated
pypi_packages.dedup();
if !pypi_packages.is_empty() {
warn!(
"The following packages are not conda packages and will be ignored: {:?}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't warn but error in this case. nobody reads warnings unless the program exits with code 1

src/pixi_lock.rs Outdated
Comment on lines 62 to 69
match package {
LockedPackageRef::Conda(conda_package) => {
let package_record = conda_package.record();
package_records.push(package_record.to_owned());
}
LockedPackageRef::Pypi(_, _) => {
pypi_packages.push(package.name().to_string());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should deduplicate this code and put it into a separate function

Comment on lines 1 to 38
[project]
name = "conda-metadata-app"
version = "0.1.0"
description = "A streamlit app to query metadata from conda packages"
authors = ["jaimergp <jaimergp@users.noreply.github.com>"]
channels = ["conda-forge"]
platforms = ["linux-64", "win-64", "osx-arm64", "osx-64"]

[tasks]
dev = "streamlit run --server.runOnSave=true app.py"
deploy = "streamlit run --server.headless=true --global.developmentMode=false app.py"
schema = "python app_config.py"

[dependencies]
python = "3.12.*"
pip = "23.3.2.*"
pydantic-settings = ">=2.4.0,<3"
pydantic = ">=2.8.2,<3"
typing-extensions = ">=4.12.2,<5"
zstandard = ">=0.23.0,<0.24"
py-rattler = ">=0.7.0,<0.8"
setuptools = "*"

[feature.dev.dependencies]
pixi-pycharm = ">=0.0.6,<0.0.7"

[pypi-dependencies]
conda-forge-metadata = ">=0.11.0,<0.12"
conda-oci-mirror = { git = "https://github.com/channel-mirrors/conda-oci-mirror.git", rev = "25ea3e436f0b0bc5a9c646121efafc9c68e116cd" } # v0.1.0
streamlit = ">=1.38.0,<2"
streamlit-searchbox = "==0.1.16"

[environments]
default = {}
dev = { features = ["dev"], no-default-feature = true }

[tool.conda-deny]
license-whitelist = "license_whitelist.toml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make this example smaller

Suggested change
[project]
name = "conda-metadata-app"
version = "0.1.0"
description = "A streamlit app to query metadata from conda packages"
authors = ["jaimergp <jaimergp@users.noreply.github.com>"]
channels = ["conda-forge"]
platforms = ["linux-64", "win-64", "osx-arm64", "osx-64"]
[tasks]
dev = "streamlit run --server.runOnSave=true app.py"
deploy = "streamlit run --server.headless=true --global.developmentMode=false app.py"
schema = "python app_config.py"
[dependencies]
python = "3.12.*"
pip = "23.3.2.*"
pydantic-settings = ">=2.4.0,<3"
pydantic = ">=2.8.2,<3"
typing-extensions = ">=4.12.2,<5"
zstandard = ">=0.23.0,<0.24"
py-rattler = ">=0.7.0,<0.8"
setuptools = "*"
[feature.dev.dependencies]
pixi-pycharm = ">=0.0.6,<0.0.7"
[pypi-dependencies]
conda-forge-metadata = ">=0.11.0,<0.12"
conda-oci-mirror = { git = "https://github.com/channel-mirrors/conda-oci-mirror.git", rev = "25ea3e436f0b0bc5a9c646121efafc9c68e116cd" } # v0.1.0
streamlit = ">=1.38.0,<2"
streamlit-searchbox = "==0.1.16"
[environments]
default = {}
dev = { features = ["dev"], no-default-feature = true }
[tool.conda-deny]
license-whitelist = "license_whitelist.toml"
[project]
name = "project-with-pypi"
channels = ["conda-forge"]
platforms = ["linux-64"]
[dependencies]
python = "3.12.*"
[pypi-dependencies]
conda-forge-metadata = ">=0.11.0,<0.12"
[tool.conda-deny]
license-whitelist = "license_whitelist.toml"

@pavelzw pavelzw changed the title Bump lock Bump lock, ensure failure for pypi packages Dec 4, 2024
@pavelzw pavelzw added the enhancement New feature or request label Dec 4, 2024
@pavelzw pavelzw changed the title Bump lock, ensure failure for pypi packages Bump rattler for new lockfile support, fail on pypi packages Dec 4, 2024
@pavelzw pavelzw merged commit 33bf78a into main Dec 4, 2024
14 checks passed
@pavelzw pavelzw deleted the bump-lock branch December 4, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants