Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3ea7c34
Added derive macro for `ProjectRead` trait.
victor-linroth-sensmetry Nov 18, 2025
8480800
Added derive macro for `ProjectMut` trait.
victor-linroth-sensmetry Nov 19, 2025
b085522
Added generic `CachedProject`.
victor-linroth-sensmetry Nov 19, 2025
fad0959
Make derive macros work both inside and outside of `sysand_core`.
victor-linroth-sensmetry Nov 19, 2025
f900f15
Makes `ProjectRead` and `ProjectMut` derive macros support generics.
victor-linroth-sensmetry Nov 20, 2025
b8d2b8e
Use `ProjectRead` derive macro for `CombinedProjectStorage`.
victor-linroth-sensmetry Nov 20, 2025
c21855c
Change `MemoryStorageEnvironment` to be generic over `Project`.
victor-linroth-sensmetry Nov 21, 2025
f0b484b
Add overrides options to `CombinedResolver` and `standard_resolver`.
victor-linroth-sensmetry Nov 24, 2025
5f87cfe
Read overrides from config file.
victor-linroth-sensmetry Nov 28, 2025
75dc6c8
Add `run_chores` script and fix `syn` dependency for macros.
victor-linroth-sensmetry Nov 28, 2025
1d74f1f
Provide command line options for source configuration when adding usa…
victor-linroth-sensmetry Dec 2, 2025
2c9b3d3
Added `nominal_path` to `LocalSrcProject`.
victor-linroth-sensmetry Dec 5, 2025
35d11c1
Added `nominal_path` to `LocalKparProject`.
victor-linroth-sensmetry Dec 8, 2025
ff2f49a
Moved overrides out of `CombinedResolver` and using `PriorityResolver…
victor-linroth-sensmetry Dec 8, 2025
c2efca4
Respect config settings.
victor-linroth-sensmetry Dec 18, 2025
c84febb
Updated docs with instructions for project source overriding.
victor-linroth-sensmetry Dec 19, 2025
810a0c0
Added configurability of editable projects.
victor-linroth-sensmetry Jan 7, 2026
823205a
Simplify CLI flags for adding path/url sources.
victor-linroth-sensmetry Jan 13, 2026
d807771
Return error if source path can't be made relative.
victor-linroth-sensmetry Jan 20, 2026
8355324
Move `AnyProject` out of standard resolver.
victor-linroth-sensmetry Jan 20, 2026
924e9d8
Added logging for when creating/updating/removing config file.
victor-linroth-sensmetry Jan 29, 2026
fa8369b
Update `index` entry in `Config` to match `projects`.
victor-linroth-sensmetry Jan 30, 2026
95a9f99
Remove unnecessary `Clone` derive.
victor-linroth-sensmetry Jan 30, 2026
bcf9e5e
Fixing incorrect path for KPARs, unintended logging and some typos.
victor-linroth-sensmetry Feb 2, 2026
49c604a
Remove `verbose`/`quiet` from config.
victor-linroth-sensmetry Feb 9, 2026
228a918
Change flags.
victor-linroth-sensmetry Feb 9, 2026
3a20e98
Update docs, docstrings and make tmp_dir private in LocalKparProject.
victor-linroth-sensmetry Feb 16, 2026
099a04f
Some refactoring and minor changes.
victor-linroth-sensmetry Feb 16, 2026
3e407c7
Add support for Git sources.
victor-linroth-sensmetry Feb 17, 2026
07da747
Change `docker-run-action`.
victor-linroth-sensmetry Feb 17, 2026
9f5be22
More transparent file system errors.
victor-linroth-sensmetry Feb 23, 2026
ad2c17d
Added docstrings to `ProjectRead` and `ProjectMut` derive macros.
victor-linroth-sensmetry Feb 23, 2026
f2eb423
Added/renamed flags and updated docs.
victor-linroth-sensmetry Feb 24, 2026
5d679d2
Tidy up path relativization.
victor-linroth-sensmetry Feb 25, 2026
e034127
Fix Windows paths in tests.
victor-linroth-sensmetry Feb 25, 2026
cb3e5c9
Tidy up function calls.
victor-linroth-sensmetry Feb 25, 2026
085d79e
No more empty sources, warn when not updating config with override, a…
victor-linroth-sensmetry Feb 26, 2026
53d6f58
Update docs, docstrings, comments and some function signatures.
victor-linroth-sensmetry Feb 26, 2026
1b52699
Add test for errors of `relativize_path`.
victor-linroth-sensmetry Feb 26, 2026
7e5c35d
Stray backtick.
victor-linroth-sensmetry Feb 26, 2026
eaeb316
Fix test.
victor-linroth-sensmetry Feb 26, 2026
e873c5c
Minor cleanup.
victor-linroth-sensmetry Feb 27, 2026
ddea97e
Minor reversion and update comment.
victor-linroth-sensmetry Feb 27, 2026
56845e6
Let paths and URLs be parsed at command line.
victor-linroth-sensmetry Feb 27, 2026
91107af
Update debug message.
victor-linroth-sensmetry Feb 27, 2026
cfbb697
Minor updates to docs and error messages.
victor-linroth-sensmetry Feb 27, 2026
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: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
path: dist
- name: pytest (native)
if: ${{ matrix.platform.native }}
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
uses: maus007/docker-run-action-fork@5ddaad0f7eedd03f64e412b1931852bd3031b273 # v1
with:
image: ${{ matrix.platform.target == 'x86' && 'i386/alpine:latest' || 'alpine:latest' }}
options: -v ${{ github.workspace }}:/io -w /io
Expand Down
26 changes: 26 additions & 0 deletions Cargo.lock

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

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[workspace]
resolver = "3"
members = ["sysand", "core", "bindings/py", "bindings/js", "bindings/java"]
members = [
"sysand",
"core",
"macros",
"bindings/py",
"bindings/js",
"bindings/java",
]

[workspace.package]
version = "0.0.9"
Expand Down
2 changes: 2 additions & 0 deletions bindings/java/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ pub extern "system" fn Java_com_sensmetry_sysand_Sysand_infoPath<'local>(
return JObject::default();
};
let project = LocalSrcProject {
nominal_path: None,
project_path: Utf8PathBuf::from(&path),
};

Expand Down Expand Up @@ -334,6 +335,7 @@ pub extern "system" fn Java_com_sensmetry_sysand_Sysand_buildProject<'local>(
return;
};
let project = LocalSrcProject {
nominal_path: None,
project_path: Utf8PathBuf::from(project_path),
};
let command_result = sysand_core::commands::build::do_build_kpar(&project, &output_path, true);
Expand Down
15 changes: 13 additions & 2 deletions bindings/py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use sysand_core::{
ProjectRead as _,
local_kpar::LocalKParProject,
local_src::{LocalSrcError, LocalSrcProject},
utils::wrapfs,
},
remove::do_remove,
resolve::standard::standard_resolver,
Expand Down Expand Up @@ -113,6 +114,7 @@ fn do_info_py_path(
let _ = pyo3_log::try_init();

let project = LocalSrcProject {
nominal_path: None,
project_path: path.into(),
};

Expand Down Expand Up @@ -184,6 +186,7 @@ fn do_build_py(output_path: String, project_path: Option<String>) -> PyResult<()
return Err(pyo3::exceptions::PyNotImplementedError::new_err("TODO"));
};
let project = LocalSrcProject {
nominal_path: None,
project_path: current_project_path.into(),
};

Expand Down Expand Up @@ -336,6 +339,7 @@ pub fn do_sources_project_py(
let mut result = vec![];

let current_project = LocalSrcProject {
nominal_path: None,
project_path: path.into(),
};

Expand Down Expand Up @@ -400,6 +404,7 @@ fn do_add_py(path: String, iri: String, version: Option<String>) -> PyResult<()>
let _ = pyo3_log::try_init();

let mut project = LocalSrcProject {
nominal_path: None,
project_path: path.into(),
};

Expand All @@ -414,6 +419,7 @@ fn do_remove_py(path: String, iri: String) -> PyResult<()> {
let _ = pyo3_log::try_init();

let mut project = LocalSrcProject {
nominal_path: None,
project_path: path.into(),
};

Expand All @@ -436,6 +442,7 @@ fn do_include_py(
let _ = pyo3_log::try_init();

let mut project = LocalSrcProject {
nominal_path: None,
project_path: path.into(),
};

Expand Down Expand Up @@ -470,6 +477,7 @@ fn do_exclude_py(path: String, src_path: String) -> PyResult<()> {
let _ = pyo3_log::try_init();

let mut project = LocalSrcProject {
nominal_path: None,
project_path: path.into(),
};

Expand All @@ -491,7 +499,9 @@ fn do_env_install_path_py(env_path: String, iri: String, location: String) -> Py
environment_path: env_path.into(),
};

if location.is_file() {
let metadata =
wrapfs::metadata(&location).map_err(|e| PyErr::new::<PyIOError, _>(e.to_string()))?;
if metadata.is_file() {
let project = LocalKParProject::new_guess_root(&location)
.map_err(|e| PyErr::new::<PyIOError, _>(e.to_string()))?;

Expand All @@ -509,8 +519,9 @@ fn do_env_install_path_py(env_path: String, iri: String, location: String) -> Py
clone_project(&project, to, true).map(|_| ())
})
.map_err(|e| PyRuntimeError::new_err(e.to_string()))?;
} else if location.is_dir() {
} else if metadata.is_dir() {
let project = LocalSrcProject {
nominal_path: None,
project_path: location,
};

Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.145", default-features = false, features = ["preserve_order"] }
sha2 = { version = "0.10.9", default-features = false }
spdx = "0.13.2"
sysand-macros = { path = "../macros"}
thiserror = { version = "2.0.17", default-features = false }
toml = "0.9.8"
typed-path = { version = "0.12.0", default-features = false }
Expand Down
22 changes: 12 additions & 10 deletions core/src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
use thiserror::Error;

use crate::{model::InterchangeProjectValidationError, project::ProjectMut};
use crate::{
model::{InterchangeProjectUsageRaw, InterchangeProjectValidationError},
project::ProjectMut,
};

#[derive(Error, Debug)]
pub enum AddError<ProjectError> {
Expand All @@ -19,19 +22,18 @@ pub fn do_add<P: ProjectMut, S: AsRef<str>>(
iri: S,
versions_constraint: Option<String>,
) -> Result<(), AddError<P::Error>> {
let usage: crate::model::InterchangeProjectUsageRaw =
crate::model::InterchangeProjectUsageRaw {
resource: iri.as_ref().to_owned(),
version_constraint: versions_constraint.clone(),
}
.validate()?
.into();
let iri = iri.as_ref();
let usage = InterchangeProjectUsageRaw {
resource: iri.to_owned(),
version_constraint: versions_constraint.clone(),
}
.validate()?
.into();

let adding = "Adding";
let header = crate::style::get_style_config().header;
log::info!(
"{header}{adding:>12}{header:#} usage: `{}` {}",
iri.as_ref(),
"{header}{adding:>12}{header:#} usage: `{iri}` {}",
versions_constraint
.as_ref()
.map(|vr| vr.to_string())
Expand Down
3 changes: 2 additions & 1 deletion core/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ pub fn do_build_workspace_kpars<P: AsRef<Utf8Path>>(
};
for project in projects {
let project = LocalSrcProject {
project_path: workspace.workspace_path.join(project.path),
nominal_path: None,
project_path: workspace.root_path().join(&project.path),
};
let file_name = default_kpar_file_name(&project)?;
let output_path = path.as_ref().join(file_name);
Expand Down
14 changes: 9 additions & 5 deletions core/src/commands/env/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
// SPDX-License-Identifier: MIT OR Apache-2.0

use crate::env::{
memory::{MemoryStorageEnvironment, MemoryWriteError},
utils::ErrorBound,
};
#[cfg(feature = "filesystem")]
use crate::{
env::local_directory::{ENTRIES_PATH, LocalDirectoryEnvironment, LocalWriteError},
project::utils::{ToPathBuf, wrapfs},
};
use crate::{
env::{
memory::{MemoryStorageEnvironment, MemoryWriteError},
utils::ErrorBound,
},
project::memory::InMemoryProject,
};

#[cfg(feature = "filesystem")]
use camino::Utf8Path;
Expand All @@ -33,7 +36,8 @@ pub enum EnvError<WriteError: ErrorBound> {
Write(#[from] WriteError),
}

pub fn do_env_memory() -> Result<MemoryStorageEnvironment, EnvError<MemoryWriteError>> {
pub fn do_env_memory()
-> Result<MemoryStorageEnvironment<InMemoryProject>, EnvError<MemoryWriteError>> {
Ok(MemoryStorageEnvironment::default())
}

Expand Down
38 changes: 23 additions & 15 deletions core/src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
};

#[cfg(feature = "filesystem")]
use crate::project::local_src::LocalSrcProject;
use crate::project::local_src::{LocalSrcError, LocalSrcProject};

use thiserror::Error;

Expand All @@ -27,14 +27,14 @@ pub enum InitError<ProjectError: ErrorBound> {
SPDXLicenseParse(Box<str>, spdx::error::ParseError),
}

pub fn do_init_ext<S: ProjectMut>(
pub fn do_init_ext<P: ProjectMut>(
name: String,
version: String,
no_semver: bool,
license: Option<String>,
no_spdx: bool,
storage: &mut S,
) -> Result<(), InitError<S::Error>> {
storage: &mut P,
) -> Result<(), InitError<P::Error>> {
if !no_semver {
Version::parse(&version).map_err(|e| InitError::SemVerParse(version.as_str().into(), e))?;
}
Expand All @@ -54,9 +54,9 @@ pub fn do_init_ext<S: ProjectMut>(

storage.put_project(
&InterchangeProjectInfoRaw {
name,
name: name.to_owned(),
description: None,
version,
version: version.to_owned(),
license,
maintainer: vec![],
topic: vec![],
Expand All @@ -78,23 +78,28 @@ pub fn do_init_ext<S: ProjectMut>(
Ok(())
}

pub fn do_init<S: ProjectMut>(
pub fn do_init<P: ProjectMut>(
name: String,
version: String,
license: Option<String>,
storage: &mut S,
) -> Result<(), InitError<S::Error>> {
storage: &mut P,
) -> Result<(), InitError<P::Error>> {
do_init_ext(name, version, false, license, false, storage)
}

pub fn do_init_memory(
name: String,
version: String,
pub fn do_init_memory<N: AsRef<str>, V: AsRef<str>>(
name: N,
version: V,
license: Option<String>,
) -> Result<InMemoryProject, InitError<crate::project::memory::InMemoryError>> {
let mut storage = InMemoryProject::default();

do_init(name, version, license, &mut storage)?;
do_init(
name.as_ref().to_owned(),
version.as_ref().to_owned(),
license,
&mut storage,
)?;

Ok(storage)
}
Expand All @@ -105,8 +110,11 @@ pub fn do_init_local_file(
version: String,
license: Option<String>,
path: Utf8PathBuf,
) -> Result<LocalSrcProject, InitError<crate::project::local_src::LocalSrcError>> {
let mut storage = LocalSrcProject { project_path: path };
) -> Result<LocalSrcProject, InitError<LocalSrcError>> {
let mut storage = LocalSrcProject {
nominal_path: None,
project_path: path,
};

do_init(name, version, license, &mut storage)?;

Expand Down
Loading
Loading