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

fix: parse channel in matchspec string #792

Merged
merged 17 commits into from
Aug 1, 2024

Conversation

ruben-arts
Copy link
Collaborator

@ruben-arts ruben-arts commented Jul 25, 2024

This now allows for:

  • "https://software.repos.intel.com/python/conda::python[version=3.9]": Having a URL as channel in this format.
  • "conda-forge::foo[subdir=linux-64]: Having a subdir in the brackets
  • "conda-forge/linux-64::foo: Having a subdir in the channel string, only if it is a platform.

@ruben-arts ruben-arts changed the title Fix/deserialize matchspec url fix: deserialize matchspec url Jul 25, 2024
@ruben-arts ruben-arts changed the title fix: deserialize matchspec url fix: deserialize matchspec url also from path Jul 25, 2024
@baszalmstra
Copy link
Collaborator

baszalmstra commented Jul 25, 2024

mm tricky, a path is also not technically a url..

Would it make sense to add path besides url?

@ruben-arts ruben-arts changed the title fix: deserialize matchspec url also from path fix: deserialization of channels and namespaces Jul 25, 2024
@ruben-arts
Copy link
Collaborator Author

I'm miss using this PR to fix #793

@baszalmstra I removed the whole URL from path part. I'll make a new PR where I add the path field.

@ruben-arts ruben-arts changed the title fix: deserialization of channels and namespaces fix!(BREAK): deserialization of channels and namespaces Jul 25, 2024
@ruben-arts ruben-arts changed the title fix!(BREAK): deserialization of channels and namespaces fix!: deserialization of channels and namespaces Jul 25, 2024
@ruben-arts ruben-arts marked this pull request as draft July 25, 2024 15:31
@ruben-arts ruben-arts changed the title fix!: deserialization of channels and namespaces fix: deserialization of channels and namespaces Jul 26, 2024
@ruben-arts ruben-arts marked this pull request as ready for review July 26, 2024 10:25
Copy link
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Does this also fix #793 ?

crates/rattler_conda_types/src/channel/mod.rs Outdated Show resolved Hide resolved
crates/rattler_conda_types/src/match_spec/parse.rs Outdated Show resolved Hide resolved
@baszalmstra baszalmstra changed the title fix: deserialization of channels and namespaces fix: parse channel in matchspec string Aug 1, 2024
@baszalmstra baszalmstra merged commit d84fb43 into conda:main Aug 1, 2024
16 checks passed
baszalmstra added a commit that referenced this pull request Aug 2, 2024
## 🤖 New release
* `rattler`: 0.27.2 -> 0.27.3 (✓ API compatible changes)
* `rattler_cache`: 0.1.4 -> 0.1.5 (✓ API compatible changes)
* `rattler_conda_types`: 0.26.3 -> 0.27.0 (⚠️ API breaking changes)
* `rattler_package_streaming`: 0.21.7 -> 0.22.0 (⚠️ API breaking
changes)
* `rattler_networking`: 0.20.10 -> 0.21.0 (⚠️ API breaking changes)
* `rattler_lock`: 0.22.16 -> 0.22.17 (✓ API compatible changes)
* `rattler_repodata_gateway`: 0.21.3 -> 0.21.4 (✓ API compatible
changes)
* `rattler_solve`: 1.0.0 -> 1.0.1 (✓ API compatible changes)
* `rattler_index`: 0.19.21 -> 0.19.22 (✓ API compatible changes)
* `rattler_shell`: 0.21.3 -> 0.21.4
* `rattler_virtual_packages`: 1.0.0 -> 1.0.1

### ⚠️ `rattler_conda_types` breaking changes

```
--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.0/src/lints/enum_variant_added.ron

Failed in:
  variant ParseChannelError:InvalidName in C:\Users\bas\AppData\Local\Temp\.tmpZUBw8C\rattler\crates\rattler_conda_types\src\channel\mod.rs:391

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.0/src/lints/enum_variant_missing.ron

Failed in:
  variant ParseMatchSpecError::InvalidNumberOfColons, previously in file C:\Users\bas\AppData\Local\Temp\.tmpiIwxAW\rattler_conda_types\src\match_spec\parse.rs:59
```

### ⚠️ `rattler_package_streaming` breaking changes

```
--- failure function_missing: pub fn removed or renamed ---

Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.0/src/lints/function_missing.ron

Failed in:
  function rattler_package_streaming::read::extract_conda, previously in file C:\Users\bas\AppData\Local\Temp\.tmpiIwxAW\rattler_package_streaming\src\read.rs:47
```

### ⚠️ `rattler_networking` breaking changes

```
--- failure function_missing: pub fn removed or renamed ---

Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.0/src/lints/function_missing.ron

Failed in:
  function rattler_networking::redact_known_secrets_from_url, previously in file C:\Users\bas\AppData\Local\Temp\.tmpiIwxAW\rattler_networking\src\redaction.rs:24

--- failure pub_module_level_const_missing: pub module-level const is missing ---

Description:
A public const is missing, renamed, or changed from const to static.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.0/src/lints/pub_module_level_const_missing.ron

Failed in:
  DEFAULT_REDACTION_STR in file C:\Users\bas\AppData\Local\Temp\.tmpiIwxAW\rattler_networking\src\redaction.rs:5

--- failure trait_missing: pub trait removed or renamed ---

Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.29.0/src/lints/trait_missing.ron

Failed in:
  trait rattler_networking::Redact, previously in file C:\Users\bas\AppData\Local\Temp\.tmpiIwxAW\rattler_networking\src\redaction.rs:44
```

<details><summary><i><b>Changelog</b></i></summary><p>

## `rattler`
<blockquote>

##
[0.27.3](baszalmstra/rattler@rattler-v0.27.2...rattler-v0.27.3)
- 2024-08-02

### Other
- mark some crates 1.0
([#789](https://github.com/baszalmstra/rattler/pull/789))
</blockquote>

## `rattler_cache`
<blockquote>

##
[0.1.5](baszalmstra/rattler@rattler_cache-v0.1.4...rattler_cache-v0.1.5)
- 2024-08-02

### Other
- mark some crates 1.0
([#789](https://github.com/baszalmstra/rattler/pull/789))
</blockquote>

## `rattler_conda_types`
<blockquote>

##
[0.27.0](baszalmstra/rattler@rattler_conda_types-v0.26.3...rattler_conda_types-v0.27.0)
- 2024-08-02

### Fixed
- redact secrets in the `canonical_name` functions
([#801](https://github.com/baszalmstra/rattler/pull/801))
- make `base_url` of `Channel` always contain a trailing slash
([#800](https://github.com/baszalmstra/rattler/pull/800))
- parse channel in matchspec string
([#792](https://github.com/baszalmstra/rattler/pull/792))
- constraints on virtual packages were ignored
([#795](https://github.com/baszalmstra/rattler/pull/795))
- url parsing for namelessmatchspec and cleanup functions
([#790](https://github.com/baszalmstra/rattler/pull/790))

### Other
- mark some crates 1.0
([#789](https://github.com/baszalmstra/rattler/pull/789))
</blockquote>

## `rattler_package_streaming`
<blockquote>

##
[0.22.0](baszalmstra/rattler@rattler_package_streaming-v0.21.7...rattler_package_streaming-v0.22.0)
- 2024-08-02

### Fixed
- redact secrets in the `canonical_name` functions
([#801](https://github.com/baszalmstra/rattler/pull/801))
- Fallback to fully reading the package stream when downloading before
attempting decompression
([#797](https://github.com/baszalmstra/rattler/pull/797))

### Other
- mark some crates 1.0
([#789](https://github.com/baszalmstra/rattler/pull/789))
</blockquote>

## `rattler_networking`
<blockquote>

##
[0.21.0](baszalmstra/rattler@rattler_networking-v0.20.10...rattler_networking-v0.21.0)
- 2024-08-02

### Fixed
- redact secrets in the `canonical_name` functions
([#801](https://github.com/baszalmstra/rattler/pull/801))
</blockquote>

## `rattler_lock`
<blockquote>

##
[0.22.17](baszalmstra/rattler@rattler_lock-v0.22.16...rattler_lock-v0.22.17)
- 2024-08-02

### Other
- mark some crates 1.0
([#789](https://github.com/baszalmstra/rattler/pull/789))
</blockquote>

## `rattler_repodata_gateway`
<blockquote>

##
[0.21.4](baszalmstra/rattler@rattler_repodata_gateway-v0.21.3...rattler_repodata_gateway-v0.21.4)
- 2024-08-02

### Fixed
- redact secrets in the `canonical_name` functions
([#801](https://github.com/baszalmstra/rattler/pull/801))

### Other
- mark some crates 1.0
([#789](https://github.com/baszalmstra/rattler/pull/789))
</blockquote>

## `rattler_solve`
<blockquote>

##
[1.0.1](baszalmstra/rattler@rattler_solve-v1.0.0...rattler_solve-v1.0.1)
- 2024-08-02

### Fixed
- constraints on virtual packages were ignored
([#795](https://github.com/baszalmstra/rattler/pull/795))
</blockquote>

## `rattler_index`
<blockquote>

##
[0.19.22](baszalmstra/rattler@rattler_index-v0.19.21...rattler_index-v0.19.22)
- 2024-08-02

### Other
- mark some crates 1.0
([#789](https://github.com/baszalmstra/rattler/pull/789))
</blockquote>

## `rattler_shell`
<blockquote>

##
[0.21.4](baszalmstra/rattler@rattler_shell-v0.21.3...rattler_shell-v0.21.4)
- 2024-08-02

### Other
- updated the following local packages: rattler_conda_types
</blockquote>

## `rattler_virtual_packages`
<blockquote>

##
[1.0.1](baszalmstra/rattler@rattler_virtual_packages-v1.0.0...rattler_virtual_packages-v1.0.1)
- 2024-08-02

### Other
- updated the following local packages: rattler_conda_types
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Signed-off-by: Bas Zalmstra <bas@prefix.dev>
baszalmstra added a commit that referenced this pull request Aug 13, 2024
Fixes #793

Continuation of #792 that
adds support for `1.2.3[channel=...]` and consolidates logic of parsing
matchspec and namelessmatchspec some more.

---------

Co-authored-by: Ruben Arts <ruben.arts@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants