mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Split puffin-package
into requirements.txt parser and pypi-types
(#341)
There are only two things left in this crate and they don't really have anything to do with one another.
This commit is contained in:
parent
1f447892f3
commit
24e30e6557
60 changed files with 135 additions and 97 deletions
88
Cargo.lock
generated
88
Cargo.lock
generated
|
@ -2232,10 +2232,11 @@ dependencies = [
|
||||||
"puffin-installer",
|
"puffin-installer",
|
||||||
"puffin-interpreter",
|
"puffin-interpreter",
|
||||||
"puffin-normalize",
|
"puffin-normalize",
|
||||||
"puffin-package",
|
|
||||||
"puffin-resolver",
|
"puffin-resolver",
|
||||||
"puffin-workspace",
|
"puffin-workspace",
|
||||||
|
"pypi-types",
|
||||||
"pyproject-toml",
|
"pyproject-toml",
|
||||||
|
"requirements-txt",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
@ -2261,7 +2262,7 @@ dependencies = [
|
||||||
"install-wheel-rs",
|
"install-wheel-rs",
|
||||||
"puffin-cache",
|
"puffin-cache",
|
||||||
"puffin-normalize",
|
"puffin-normalize",
|
||||||
"puffin-package",
|
"pypi-types",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"reqwest-middleware",
|
"reqwest-middleware",
|
||||||
"reqwest-retry",
|
"reqwest-retry",
|
||||||
|
@ -2296,8 +2297,8 @@ dependencies = [
|
||||||
"puffin-client",
|
"puffin-client",
|
||||||
"puffin-dispatch",
|
"puffin-dispatch",
|
||||||
"puffin-interpreter",
|
"puffin-interpreter",
|
||||||
"puffin-package",
|
|
||||||
"puffin-traits",
|
"puffin-traits",
|
||||||
|
"pypi-types",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
@ -2322,9 +2323,9 @@ dependencies = [
|
||||||
"puffin-distribution",
|
"puffin-distribution",
|
||||||
"puffin-installer",
|
"puffin-installer",
|
||||||
"puffin-interpreter",
|
"puffin-interpreter",
|
||||||
"puffin-package",
|
|
||||||
"puffin-resolver",
|
"puffin-resolver",
|
||||||
"puffin-traits",
|
"puffin-traits",
|
||||||
|
"pypi-types",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
@ -2338,7 +2339,7 @@ dependencies = [
|
||||||
"puffin-cache",
|
"puffin-cache",
|
||||||
"puffin-git",
|
"puffin-git",
|
||||||
"puffin-normalize",
|
"puffin-normalize",
|
||||||
"puffin-package",
|
"pypi-types",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2379,8 +2380,8 @@ dependencies = [
|
||||||
"puffin-git",
|
"puffin-git",
|
||||||
"puffin-interpreter",
|
"puffin-interpreter",
|
||||||
"puffin-normalize",
|
"puffin-normalize",
|
||||||
"puffin-package",
|
|
||||||
"puffin-traits",
|
"puffin-traits",
|
||||||
|
"pypi-types",
|
||||||
"rayon",
|
"rayon",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -2412,39 +2413,9 @@ dependencies = [
|
||||||
name = "puffin-normalize"
|
name = "puffin-normalize"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
|
||||||
"indoc",
|
|
||||||
"insta",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
|
||||||
"tempfile",
|
|
||||||
"test-case",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "puffin-package"
|
|
||||||
version = "0.0.1"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"fs-err",
|
|
||||||
"indoc",
|
|
||||||
"insta",
|
|
||||||
"mailparse",
|
|
||||||
"once_cell",
|
|
||||||
"pep440_rs 0.3.12",
|
|
||||||
"pep508_rs",
|
|
||||||
"puffin-normalize",
|
|
||||||
"regex",
|
|
||||||
"rfc2047-decoder",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tempfile",
|
|
||||||
"test-case",
|
|
||||||
"thiserror",
|
|
||||||
"tracing",
|
|
||||||
"unscanny",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2477,8 +2448,8 @@ dependencies = [
|
||||||
"puffin-git",
|
"puffin-git",
|
||||||
"puffin-interpreter",
|
"puffin-interpreter",
|
||||||
"puffin-normalize",
|
"puffin-normalize",
|
||||||
"puffin-package",
|
|
||||||
"puffin-traits",
|
"puffin-traits",
|
||||||
|
"pypi-types",
|
||||||
"sha2",
|
"sha2",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -2585,6 +2556,27 @@ dependencies = [
|
||||||
"syn 2.0.39",
|
"syn 2.0.39",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pypi-types"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"indoc",
|
||||||
|
"insta",
|
||||||
|
"mailparse",
|
||||||
|
"once_cell",
|
||||||
|
"pep440_rs 0.3.12",
|
||||||
|
"pep508_rs",
|
||||||
|
"puffin-normalize",
|
||||||
|
"regex",
|
||||||
|
"rfc2047-decoder",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tempfile",
|
||||||
|
"test-case",
|
||||||
|
"thiserror",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyproject-toml"
|
name = "pyproject-toml"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
@ -2765,6 +2757,28 @@ version = "0.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "requirements-txt"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"fs-err",
|
||||||
|
"indoc",
|
||||||
|
"insta",
|
||||||
|
"once_cell",
|
||||||
|
"pep440_rs 0.3.12",
|
||||||
|
"pep508_rs",
|
||||||
|
"puffin-normalize",
|
||||||
|
"regex",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tempfile",
|
||||||
|
"test-case",
|
||||||
|
"thiserror",
|
||||||
|
"tracing",
|
||||||
|
"unscanny",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reqwest"
|
name = "reqwest"
|
||||||
version = "0.11.22"
|
version = "0.11.22"
|
||||||
|
|
|
@ -27,7 +27,8 @@ puffin-distribution = { path = "../puffin-distribution" }
|
||||||
puffin-installer = { path = "../puffin-installer" }
|
puffin-installer = { path = "../puffin-installer" }
|
||||||
puffin-interpreter = { path = "../puffin-interpreter" }
|
puffin-interpreter = { path = "../puffin-interpreter" }
|
||||||
puffin-normalize = { path = "../puffin-normalize" }
|
puffin-normalize = { path = "../puffin-normalize" }
|
||||||
puffin-package = { path = "../puffin-package" }
|
pypi-types = { path = "../pypi-types" }
|
||||||
|
requirements-txt = { path = "../requirements-txt" }
|
||||||
puffin-resolver = { path = "../puffin-resolver", features = ["clap"] }
|
puffin-resolver = { path = "../puffin-resolver", features = ["clap"] }
|
||||||
puffin-workspace = { path = "../puffin-workspace" }
|
puffin-workspace = { path = "../puffin-workspace" }
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ use fs_err as fs;
|
||||||
|
|
||||||
use pep508_rs::Requirement;
|
use pep508_rs::Requirement;
|
||||||
use puffin_normalize::{ExtraName, PackageName};
|
use puffin_normalize::{ExtraName, PackageName};
|
||||||
use puffin_package::requirements_txt::RequirementsTxt;
|
use requirements_txt::RequirementsTxt;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) enum RequirementsSource {
|
pub(crate) enum RequirementsSource {
|
||||||
|
|
|
@ -8,7 +8,7 @@ distribution-filename = { path = "../distribution-filename" }
|
||||||
install-wheel-rs = { path = "../install-wheel-rs" }
|
install-wheel-rs = { path = "../install-wheel-rs" }
|
||||||
puffin-cache = { path = "../puffin-cache" }
|
puffin-cache = { path = "../puffin-cache" }
|
||||||
puffin-normalize = { path = "../puffin-normalize" }
|
puffin-normalize = { path = "../puffin-normalize" }
|
||||||
puffin-package = { path = "../puffin-package" }
|
pypi-types = { path = "../pypi-types" }
|
||||||
|
|
||||||
async_http_range_reader = { workspace = true }
|
async_http_range_reader = { workspace = true }
|
||||||
async_zip = { workspace = true }
|
async_zip = { workspace = true }
|
||||||
|
|
|
@ -21,7 +21,7 @@ use url::Url;
|
||||||
use distribution_filename::WheelFilename;
|
use distribution_filename::WheelFilename;
|
||||||
use install_wheel_rs::find_dist_info_metadata;
|
use install_wheel_rs::find_dist_info_metadata;
|
||||||
use puffin_normalize::PackageName;
|
use puffin_normalize::PackageName;
|
||||||
use puffin_package::pypi_types::{File, Metadata21, SimpleJson};
|
use pypi_types::{File, Metadata21, SimpleJson};
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
use crate::remote_metadata::{
|
use crate::remote_metadata::{
|
||||||
|
|
|
@ -5,7 +5,6 @@ use async_zip::error::ZipError;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use distribution_filename::WheelFilename;
|
use distribution_filename::WheelFilename;
|
||||||
use puffin_package::pypi_types;
|
|
||||||
|
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
|
|
|
@ -10,7 +10,7 @@ use url::Url;
|
||||||
use distribution_filename::WheelFilename;
|
use distribution_filename::WheelFilename;
|
||||||
use install_wheel_rs::find_dist_info_metadata;
|
use install_wheel_rs::find_dist_info_metadata;
|
||||||
use puffin_cache::CanonicalUrl;
|
use puffin_cache::CanonicalUrl;
|
||||||
use puffin_package::pypi_types::Metadata21;
|
use pypi_types::Metadata21;
|
||||||
|
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ puffin-build = { path = "../puffin-build" }
|
||||||
puffin-client = { path = "../puffin-client" }
|
puffin-client = { path = "../puffin-client" }
|
||||||
puffin-dispatch = { path = "../puffin-dispatch" }
|
puffin-dispatch = { path = "../puffin-dispatch" }
|
||||||
puffin-interpreter = { path = "../puffin-interpreter" }
|
puffin-interpreter = { path = "../puffin-interpreter" }
|
||||||
puffin-package = { path = "../puffin-package" }
|
pypi-types = { path = "../pypi-types" }
|
||||||
puffin-traits = { path = "../puffin-traits" }
|
puffin-traits = { path = "../puffin-traits" }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
|
|
|
@ -20,9 +20,9 @@ puffin-client = { path = "../puffin-client" }
|
||||||
puffin-distribution = { path = "../puffin-distribution" }
|
puffin-distribution = { path = "../puffin-distribution" }
|
||||||
puffin-installer = { path = "../puffin-installer" }
|
puffin-installer = { path = "../puffin-installer" }
|
||||||
puffin-interpreter = { path = "../puffin-interpreter" }
|
puffin-interpreter = { path = "../puffin-interpreter" }
|
||||||
puffin-package = { path = "../puffin-package" }
|
|
||||||
puffin-resolver = { path = "../puffin-resolver" }
|
puffin-resolver = { path = "../puffin-resolver" }
|
||||||
puffin-traits = { path = "../puffin-traits" }
|
puffin-traits = { path = "../puffin-traits" }
|
||||||
|
pypi-types = { path = "../pypi-types" }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
itertools = { workspace = true }
|
itertools = { workspace = true }
|
||||||
|
|
|
@ -14,7 +14,7 @@ pep440_rs = { path = "../pep440-rs" }
|
||||||
puffin-cache = { path = "../puffin-cache" }
|
puffin-cache = { path = "../puffin-cache" }
|
||||||
puffin-git = { path = "../puffin-git" }
|
puffin-git = { path = "../puffin-git" }
|
||||||
puffin-normalize = { path = "../puffin-normalize" }
|
puffin-normalize = { path = "../puffin-normalize" }
|
||||||
puffin-package = { path = "../puffin-package" }
|
pypi-types = { path = "../pypi-types" }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
|
|
|
@ -8,7 +8,7 @@ use url::Url;
|
||||||
use pep440_rs::Version;
|
use pep440_rs::Version;
|
||||||
use puffin_cache::CanonicalUrl;
|
use puffin_cache::CanonicalUrl;
|
||||||
use puffin_normalize::PackageName;
|
use puffin_normalize::PackageName;
|
||||||
use puffin_package::pypi_types::File;
|
use pypi_types::File;
|
||||||
|
|
||||||
pub mod source;
|
pub mod source;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ authors = { workspace = true }
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
distribution-filename = { path = "../distribution-filename" }
|
||||||
install-wheel-rs = { path = "../install-wheel-rs", default-features = false }
|
install-wheel-rs = { path = "../install-wheel-rs", default-features = false }
|
||||||
pep440_rs = { path = "../pep440-rs" }
|
pep440_rs = { path = "../pep440-rs" }
|
||||||
pep508_rs = { path = "../pep508-rs" }
|
pep508_rs = { path = "../pep508-rs" }
|
||||||
|
@ -19,9 +20,8 @@ puffin-distribution = { path = "../puffin-distribution" }
|
||||||
puffin-git = { path = "../puffin-git" }
|
puffin-git = { path = "../puffin-git" }
|
||||||
puffin-interpreter = { path = "../puffin-interpreter" }
|
puffin-interpreter = { path = "../puffin-interpreter" }
|
||||||
puffin-normalize = { path = "../puffin-normalize" }
|
puffin-normalize = { path = "../puffin-normalize" }
|
||||||
puffin-package = { path = "../puffin-package" }
|
|
||||||
puffin-traits = { path = "../puffin-traits" }
|
puffin-traits = { path = "../puffin-traits" }
|
||||||
distribution-filename = { path = "../distribution-filename" }
|
pypi-types = { path = "../pypi-types" }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
cacache = { workspace = true }
|
cacache = { workspace = true }
|
||||||
|
|
|
@ -5,14 +5,6 @@ edition = "2021"
|
||||||
description = "Normalization for distribution, package and extra anmes"
|
description = "Normalization for distribution, package and extra anmes"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = { workspace = true }
|
|
||||||
once_cell = { workspace = true }
|
once_cell = { workspace = true }
|
||||||
regex = { workspace = true }
|
regex = { workspace = true }
|
||||||
serde = { workspace = true, features = ["derive"] }
|
serde = { workspace = true, features = ["derive"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
indoc = { version = "2.0.4" }
|
|
||||||
insta = { version = "1.34.0" }
|
|
||||||
serde_json = { version = "1.0.108" }
|
|
||||||
tempfile = { version = "3.8.1" }
|
|
||||||
test-case = { version = "3.2.1" }
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
pub mod pypi_types;
|
|
||||||
pub mod requirements_txt;
|
|
|
@ -10,6 +10,7 @@ authors = { workspace = true }
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
distribution-filename = { path = "../distribution-filename" }
|
||||||
install-wheel-rs = { path = "../install-wheel-rs" }
|
install-wheel-rs = { path = "../install-wheel-rs" }
|
||||||
pep440_rs = { path = "../pep440-rs" }
|
pep440_rs = { path = "../pep440-rs" }
|
||||||
pep508_rs = { path = "../pep508-rs" }
|
pep508_rs = { path = "../pep508-rs" }
|
||||||
|
@ -19,11 +20,10 @@ pubgrub = { path = "../../vendor/pubgrub" }
|
||||||
puffin-cache = { path = "../puffin-cache" }
|
puffin-cache = { path = "../puffin-cache" }
|
||||||
puffin-client = { path = "../puffin-client" }
|
puffin-client = { path = "../puffin-client" }
|
||||||
puffin-distribution = { path = "../puffin-distribution" }
|
puffin-distribution = { path = "../puffin-distribution" }
|
||||||
puffin-normalize = { path = "../puffin-normalize" }
|
|
||||||
puffin-package = { path = "../puffin-package" }
|
|
||||||
puffin-traits = { path = "../puffin-traits" }
|
|
||||||
puffin-git = { path = "../puffin-git" }
|
puffin-git = { path = "../puffin-git" }
|
||||||
distribution-filename = { path = "../distribution-filename" }
|
puffin-normalize = { path = "../puffin-normalize" }
|
||||||
|
puffin-traits = { path = "../puffin-traits" }
|
||||||
|
pypi-types = { path = "../pypi-types" }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
bitflags = { workspace = true }
|
bitflags = { workspace = true }
|
||||||
|
|
|
@ -7,7 +7,7 @@ use zip::ZipArchive;
|
||||||
use distribution_filename::WheelFilename;
|
use distribution_filename::WheelFilename;
|
||||||
use platform_tags::Tags;
|
use platform_tags::Tags;
|
||||||
use puffin_distribution::RemoteDistributionRef;
|
use puffin_distribution::RemoteDistributionRef;
|
||||||
use puffin_package::pypi_types::Metadata21;
|
use pypi_types::Metadata21;
|
||||||
|
|
||||||
/// A cached wheel built from a remote source.
|
/// A cached wheel built from a remote source.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -17,8 +17,8 @@ use puffin_client::RegistryClient;
|
||||||
use puffin_distribution::source::Source;
|
use puffin_distribution::source::Source;
|
||||||
use puffin_distribution::RemoteDistributionRef;
|
use puffin_distribution::RemoteDistributionRef;
|
||||||
use puffin_git::{Git, GitSource};
|
use puffin_git::{Git, GitSource};
|
||||||
use puffin_package::pypi_types::Metadata21;
|
|
||||||
use puffin_traits::BuildContext;
|
use puffin_traits::BuildContext;
|
||||||
|
use pypi_types::Metadata21;
|
||||||
|
|
||||||
use crate::distribution::cached_wheel::CachedWheel;
|
use crate::distribution::cached_wheel::CachedWheel;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ use distribution_filename::WheelFilename;
|
||||||
use platform_tags::Tags;
|
use platform_tags::Tags;
|
||||||
use puffin_client::RegistryClient;
|
use puffin_client::RegistryClient;
|
||||||
use puffin_distribution::RemoteDistributionRef;
|
use puffin_distribution::RemoteDistributionRef;
|
||||||
use puffin_package::pypi_types::Metadata21;
|
use pypi_types::Metadata21;
|
||||||
|
|
||||||
use crate::distribution::cached_wheel::CachedWheel;
|
use crate::distribution::cached_wheel::CachedWheel;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use distribution_filename::{SourceDistributionFilename, WheelFilename};
|
use distribution_filename::{SourceDistributionFilename, WheelFilename};
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
use puffin_package::pypi_types::File;
|
use pypi_types::File;
|
||||||
|
|
||||||
/// A distribution can either be a wheel or a source distribution.
|
/// A distribution can either be a wheel or a source distribution.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
@ -15,7 +15,7 @@ use platform_tags::Tags;
|
||||||
use puffin_client::RegistryClient;
|
use puffin_client::RegistryClient;
|
||||||
use puffin_distribution::RemoteDistribution;
|
use puffin_distribution::RemoteDistribution;
|
||||||
use puffin_normalize::PackageName;
|
use puffin_normalize::PackageName;
|
||||||
use puffin_package::pypi_types::{File, SimpleJson};
|
use pypi_types::{File, SimpleJson};
|
||||||
|
|
||||||
use crate::error::ResolveError;
|
use crate::error::ResolveError;
|
||||||
use crate::resolution::Resolution;
|
use crate::resolution::Resolution;
|
||||||
|
|
|
@ -13,7 +13,7 @@ use pep440_rs::{Version, VersionSpecifier, VersionSpecifiers};
|
||||||
use pep508_rs::{Requirement, VersionOrUrl};
|
use pep508_rs::{Requirement, VersionOrUrl};
|
||||||
use puffin_distribution::RemoteDistribution;
|
use puffin_distribution::RemoteDistribution;
|
||||||
use puffin_normalize::PackageName;
|
use puffin_normalize::PackageName;
|
||||||
use puffin_package::pypi_types::File;
|
use pypi_types::File;
|
||||||
|
|
||||||
use crate::pubgrub::{PubGrubPackage, PubGrubPriority, PubGrubVersion};
|
use crate::pubgrub::{PubGrubPackage, PubGrubPriority, PubGrubVersion};
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ use puffin_cache::{CanonicalUrl, RepositoryUrl};
|
||||||
use puffin_client::RegistryClient;
|
use puffin_client::RegistryClient;
|
||||||
use puffin_distribution::{RemoteDistributionRef, VersionOrUrl};
|
use puffin_distribution::{RemoteDistributionRef, VersionOrUrl};
|
||||||
use puffin_normalize::{ExtraName, PackageName};
|
use puffin_normalize::{ExtraName, PackageName};
|
||||||
use puffin_package::pypi_types::{File, Metadata21, SimpleJson};
|
|
||||||
use puffin_traits::BuildContext;
|
use puffin_traits::BuildContext;
|
||||||
|
use pypi_types::{File, Metadata21, SimpleJson};
|
||||||
|
|
||||||
use crate::candidate_selector::CandidateSelector;
|
use crate::candidate_selector::CandidateSelector;
|
||||||
use crate::distribution::{SourceDistributionFetcher, WheelFetcher};
|
use crate::distribution::{SourceDistributionFetcher, WheelFetcher};
|
||||||
|
|
30
crates/pypi-types/Cargo.toml
Normal file
30
crates/pypi-types/Cargo.toml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
[package]
|
||||||
|
name = "pypi-types"
|
||||||
|
version = "0.0.1"
|
||||||
|
edition = { workspace = true }
|
||||||
|
rust-version = { workspace = true }
|
||||||
|
homepage = { workspace = true }
|
||||||
|
documentation = { workspace = true }
|
||||||
|
repository = { workspace = true }
|
||||||
|
authors = { workspace = true }
|
||||||
|
license = { workspace = true }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
pep440_rs = { path = "../pep440-rs", features = ["serde"] }
|
||||||
|
pep508_rs = { path = "../pep508-rs", features = ["serde"] }
|
||||||
|
puffin-normalize = { path = "../puffin-normalize" }
|
||||||
|
|
||||||
|
mailparse = { workspace = true }
|
||||||
|
once_cell = { workspace = true }
|
||||||
|
regex = { workspace = true }
|
||||||
|
rfc2047-decoder = { workspace = true }
|
||||||
|
serde = { workspace = true }
|
||||||
|
thiserror = { workspace = true }
|
||||||
|
tracing = { workspace = true }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
indoc = { version = "2.0.4" }
|
||||||
|
insta = { version = "1.34.0" }
|
||||||
|
serde_json = { version = "1.0.108" }
|
||||||
|
tempfile = { version = "3.8.1" }
|
||||||
|
test-case = { version = "3.2.1" }
|
|
@ -1,25 +1,29 @@
|
||||||
[package]
|
[package]
|
||||||
name = "puffin-package"
|
name = "requirements-txt"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
edition = "2021"
|
edition = { workspace = true }
|
||||||
|
rust-version = { workspace = true }
|
||||||
|
homepage = { workspace = true }
|
||||||
|
documentation = { workspace = true }
|
||||||
|
repository = { workspace = true }
|
||||||
|
authors = { workspace = true }
|
||||||
|
license = { workspace = true }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
pep440_rs = { path = "../pep440-rs", features = ["serde"] }
|
pep440_rs = { path = "../pep440-rs", features = ["serde"] }
|
||||||
pep508_rs = { path = "../pep508-rs", features = ["serde"] }
|
pep508_rs = { path = "../pep508-rs", features = ["serde"] }
|
||||||
puffin-normalize = { path = "../puffin-normalize" }
|
puffin-normalize = { path = "../puffin-normalize" }
|
||||||
|
|
||||||
anyhow = { workspace = true }
|
|
||||||
fs-err = { workspace = true }
|
fs-err = { workspace = true }
|
||||||
mailparse = { workspace = true }
|
|
||||||
once_cell = { workspace = true }
|
once_cell = { workspace = true }
|
||||||
regex = { workspace = true }
|
regex = { workspace = true }
|
||||||
rfc2047-decoder = { workspace = true }
|
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
tracing.workspace = true
|
tracing = { workspace = true }
|
||||||
unscanny = { workspace = true }
|
unscanny = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
anyhow = { workspace = true }
|
||||||
indoc = { version = "2.0.4" }
|
indoc = { version = "2.0.4" }
|
||||||
insta = { version = "1.34.0" }
|
insta = { version = "1.34.0" }
|
||||||
serde_json = { version = "1.0.108" }
|
serde_json = { version = "1.0.108" }
|
|
@ -473,7 +473,7 @@ mod test {
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
use test_case::test_case;
|
use test_case::test_case;
|
||||||
|
|
||||||
use crate::requirements_txt::RequirementsTxt;
|
use crate::RequirementsTxt;
|
||||||
|
|
||||||
#[test_case(Path::new("basic.txt"))]
|
#[test_case(Path::new("basic.txt"))]
|
||||||
#[test_case(Path::new("constraints-a.txt"))]
|
#[test_case(Path::new("constraints-a.txt"))]
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
source: crates/puffin-package/src/requirements_txt.rs
|
source: crates/requirements-txt/src/lib.rs
|
||||||
expression: actual
|
expression: actual
|
||||||
---
|
---
|
||||||
RequirementsTxt {
|
RequirementsTxt {
|
Loading…
Add table
Add a link
Reference in a new issue