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

refactor: project model using targets, features and environments #616

Merged
merged 7 commits into from
Jan 6, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
refactor: split the manifest into seperate files
  • Loading branch information
baszalmstra committed Jan 6, 2024
commit 0d266515eba842dbf2afe45720e797f92e6cd636
90 changes: 55 additions & 35 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ regex = "1.10.2"
reqwest = { version = "0.11.22", default-features = false }
rip = { package = "rattler_installs_packages", version = "0.1.0", default-features = false }
serde = "1.0.193"
serde-untagged = "0.1.5"
serde_json = "1.0.108"
serde_spanned = "0.6.4"
serde_with = { version = "3.4.0", features = ["indexmap"] }
7 changes: 7 additions & 0 deletions src/project/manifest/activation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use serde::Deserialize;

#[derive(Default, Clone, Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Activation {
pub scripts: Option<Vec<String>>,
}
54 changes: 54 additions & 0 deletions src/project/manifest/metadata.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
use crate::utils::spanned::PixiSpanned;
use rattler_conda_types::{Channel, Platform, Version};
use serde::Deserialize;
use serde_with::{serde_as, DisplayFromStr};
use std::path::PathBuf;
use url::Url;

/// Describes the contents of the `[package]` section of the project manifest.
#[serde_as]
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ProjectMetadata {
/// The name of the project
pub name: String,

/// The version of the project
#[serde_as(as = "Option<DisplayFromStr>")]
pub version: Option<Version>,

/// An optional project description
pub description: Option<String>,

/// Optional authors
#[serde(default)]
pub authors: Vec<String>,

/// The channels used by the project
#[serde_as(deserialize_as = "Vec<crate::project::serde::ChannelStr>")]
pub channels: Vec<Channel>,

/// The platforms this project supports
// TODO: This is actually slightly different from the rattler_conda_types::Platform because it
// should not include noarch.
pub platforms: PixiSpanned<Vec<Platform>>,

/// The license as a valid SPDX string (e.g. MIT AND Apache-2.0)
pub license: Option<String>,

/// The license file (relative to the project root)
#[serde(rename = "license-file")]
pub license_file: Option<PathBuf>,

/// Path to the README file of the project (relative to the project root)
pub readme: Option<PathBuf>,

/// URL of the project homepage
pub homepage: Option<Url>,

/// URL of the project source repository
pub repository: Option<Url>,

/// URL of the project documentation
pub documentation: Option<Url>,
}
Loading
Loading