Skip to content

Merge linkml-runtime into linkml, creating a uv monorepo#2977

Closed
kevinschaper wants to merge 1365 commits intomainfrom
merge-runtime
Closed

Merge linkml-runtime into linkml, creating a uv monorepo#2977
kevinschaper wants to merge 1365 commits intomainfrom
merge-runtime

Conversation

@kevinschaper
Copy link
Contributor

Re-do of #2873, merging runtime into linkml as part of a uv monorepo

Initially, this PR has the git work done and some minimal changes to the top level and runtime pyproject.toml, but fails on uv sync. Pushing to a draft PR to share the work of fixing it.

sierra-moxon and others added 30 commits July 14, 2025 07:45
Converting the "issue" tests to pytest
…ew tests should now be in the test_schemaview.py file.
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.
Fix the remote import issue in SchemaViewer and a couple of misc minor bugs
ialarmedalien and others added 23 commits October 21, 2025 09:54
…t_args

schemaview.py: allow `detect_cycles` to receive a list of nodes as args
schemaview.py: minor reorg and test reorganisation
schemaview.py: add get_string_type to retrieve typedef for strings
…parent_plurality

schemaview.py: deprecate `permissible_value_parent`, replace with `permissible_value_parents`
…ange_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>
…name

module_name parameter for compile_python resolves #2903
@sneakers-the-rat
Copy link
Collaborator

Reupping suggestion of using namespace package structure #2873 (comment)

@dalito
Copy link
Member

dalito commented Oct 27, 2025

@sneakers-the-rat - where would you see the advantage of PEP420 namespaces (which would put linkml and linkml-runtime under the same src/ directory with a single pyproject.toml) vs. uv-workspaces where each package has its own pyproject.toml in addition to a root-pyproject.toml? As far as I know one goal was to still be able to realease linkml and linkml-runtimes independently which is not possible with PEP420 (or is it?).

Regarding tests I would also prefer to have them per package as you suggested.

@sneakers-the-rat
Copy link
Collaborator

sneakers-the-rat commented Oct 27, 2025

PEP420 namespaces (which would put linkml and linkml-runtime under the same src/ directory with a single pyproject.toml

not so! here is an example repo using uv workspaces and namespace packages.

The directory structure would be something like this

.
├── packages
│   ├── linkml-pydantic
│   │   ├── pyproject.toml
│   │   └── src
│   │       └── linkml
│   │           └── generators
│   │               └── pydantic
│   ├── linkml-runtime
│   │   ├── pyproject.toml
│   │   └── src
│   │       └── linkml
│   │           └── runtime
│   └── linkml-schemaview
│       ├── pyproject.toml
│       └── src
│           └── linkml
│               └── schemaview
└── pyproject.toml

where each subpackage can be independent:

  • e.g. distributed as linkml-runtime , linkml-schemaview , etc.
  • have independent deps (including within-monorepo deps as per the core/modular install issue )

but then each becomes part of a shared namespace, so one might install linkml-runtime and then do from linkml import runtime rather than from linkml_runtime import ....

the reason this is preferable to just piling the existing packages into a single repository is that it gives us room to further modularize the package in a way that has a single design, rather than making this huge change and still being stuck with "well there are these legacy packages that behave differently but..." - specifically i want to split off the pydantic generator into its own package that i can install separately, but in order to avoid breaking everything, ideally it would still be installed and used like from linkml.generators.pydantic ...

edit: and also we could keep the tests separate too, i just didn't put that in the example file tree

edit2: we could do both, but i figure having all the subpackages behave similarly would probably be a good change instead of having a few "special" packages that are not part of the linkml namespace and that becoming confusing in a few years

@dalito
Copy link
Member

dalito commented Oct 27, 2025

Thanks for the detailed reply @sneakers-the-rat . This structure is also what I meant with "uv-workpaces" solution. I was just not sure if you implied something different with the PEP-240 reference.

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.