Skip to content

Migrate to uv-workspace monorepo with src-layout#2982

Closed
dalito wants to merge 1372 commits intolinkml:mainfrom
dalito:merge-runtime-pep440
Closed

Migrate to uv-workspace monorepo with src-layout#2982
dalito wants to merge 1372 commits intolinkml:mainfrom
dalito:merge-runtime-pep440

Conversation

@dalito
Copy link
Member

@dalito dalito commented Oct 29, 2025

Summary

Migrates the repository to a uv-workspace monorepo structure with src-layout for both packages. Builds upon #2977.

I checked out #2977 and ran https://gist.github.com/dalito/15b68d2e3b60f2501dbd2d95408cafff

This does not try to split up linkml to several subpackages (what @sneakers-the-rat proposed in #2977). I think that should be done separately.

Structure

├── packages/
│   ├── linkml/
│   │   ├── pyproject.toml
│   │   ├── src/linkml/
│   │   └── tests/
│   └── linkml_runtime/
│       ├── pyproject.toml
│       ├── src/linkml_runtime/
│       └── tests/
├── pyproject.toml (workspace root)
└── notebooks/

Changes

  • Restructured repository as uv-workspace with packages/* members
  • Adopted src-layout for both linkml and linkml_runtime packages
  • Moved source: linkml/packages/linkml/src/linkml/
  • Moved source: packages/linkml_runtime/*packages/linkml_runtime/src/linkml_runtime/
  • Moved tests to package-specific directories
  • Configured workspace in root pyproject.toml
  • Created individual pyproject.toml for each package
  • Maintained linkml_runtime import path (no breaking changes)

Build & Install

# Install workspace
uv sync

# Build individual packages
cd packages/linkml && uv build
cd packages/linkml_runtime && uv build

Test Results

  • linkml_runtime: 1,626 passed in 100s
  • linkml: 8,355 passed in 246s
  • Total: 9,981 tests passed

Notes

  • Single lockfile for consistent dependencies across packages
  • Individual packages can be built and distributed separately
  • Test suites fully functional in new structure
  • Fixed notebooks path reference for monorepo layout

sierra-moxon and others added 30 commits July 14, 2025 13:56
Create URIs (w3id.org PURLs) for Enums in same style as for classes & slots
… import merge-related tests are at the top of the file.
SchemaView remote import bug fix prep: test reorganisation
Fix a couple of bugs where the wrong type is reported in an error message.
Cut down some needlessly verbose sorting code.
…ort_tests

Fix the remote import issue in SchemaViewer and a couple of misc minor bugs
Fix incorrect YAML encoding, ignore intentionally corrupted files
…otebook

Fixup Monarch Schemaview notebook
generating URI to Path / str(Path) maps in __init__
- create error messages before raise exceptions
- simplify some if/else cascades
- fix variable naming convention violations
amc-corey-cox and others added 26 commits October 22, 2025 10:41
schemaview.py: minor reorg and test reorganisation
schemaview.py: add get_string_type to retrieve typedef for strings
…value_parent_plurality

schemaview.py: deprecate `permissible_value_parent`, replace with `permissible_value_parents`
…k_to_range_fns

schemaview.py: check for a valid slot def before calling a function
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.9.1 to 7.10.7.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](coveragepy/coveragepy@7.9.1...7.10.7)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.10.7
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the dependencies group with 2 updates: [pyyaml](https://github.com/yaml/pyyaml) and [requests](https://github.com/psf/requests).


Updates `pyyaml` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/6.0.3/CHANGES)
- [Commits](yaml/pyyaml@6.0.2...6.0.3)

Updates `requests` from 2.32.4 to 2.32.5
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](psf/requests@v2.32.4...v2.32.5)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: requests
  dependency-version: 2.32.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [jsonschema](https://github.com/python-jsonschema/jsonschema) from 4.24.0 to 4.25.1.
- [Release notes](https://github.com/python-jsonschema/jsonschema/releases)
- [Changelog](https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst)
- [Commits](python-jsonschema/jsonschema@v4.24.0...v4.25.1)

---
updated-dependencies:
- dependency-name: jsonschema
  dependency-version: 4.25.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [curies](https://github.com/biopragmatics/curies) from 0.10.19 to 0.10.23.
- [Release notes](https://github.com/biopragmatics/curies/releases)
- [Commits](biopragmatics/curies@v0.10.19...v0.10.23)

---
updated-dependencies:
- dependency-name: curies
  dependency-version: 0.10.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…odule_name

module_name parameter for compile_python resolves linkml#2903
This is part of the monorepo migration to uv-workspace structure.
Moves the main linkml package source code to its proper location.
Moves all linkml-specific tests to the new monorepo structure.
Runtime tests remain in tests/linkml_runtime/ for next step.
Moves runtime tests from tests/linkml_runtime/ to the package-specific
tests directory. Removes the now-empty root tests directory.
Moves runtime source code from packages/linkml_runtime/* to
packages/linkml_runtime/src/linkml/runtime/* following the
proper package structure for the monorepo.
Move from src/linkml/runtime to src/linkml_runtime to maintain
the linkml_runtime import path and avoid breaking changes.
- Update monorepo-cleanup.sh to use correct src/linkml_runtime path
- Add packages/linkml/pyproject.toml with workspace configuration
- Add packages/linkml/README.md
- Configure hatchling build targets for both packages
- Workspace now supports 'uv sync' and individual package builds
Updated test_notebooks.py to use correct relative path to notebooks
directory from the new monorepo location (packages/linkml/tests).
@sneakers-the-rat
Copy link
Collaborator

agreed that splitting up linkml into subpackages should be done separately, fwiw. i like da look of this

@dalito
Copy link
Member Author

dalito commented Nov 22, 2025

This was continued in #2987. So I am closing this PR.

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.