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

Make pyshacl an extra #1992

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Make pyshacl an extra #1992

merged 2 commits into from
Mar 21, 2024

Conversation

sneakers-the-rat
Copy link
Collaborator

Noticed this while doing #1991

pyshacl is currently in its own (required) poetry group.

Poetry groups are only visible when installing with poetry -- ie. they are invisible to pip. the docs say:

Dependency groups, other than the implicit main group, must only contain dependencies you need in your development process. Installing them is only possible by using Poetry.

To declare a set of dependencies, which add additional functionality to the project during runtime, use extras instead. Extras can be installed by the end user using pip.

If one builds an sdist, one will notice that pyshacl is not present in the PKG-INFO, which is what pip will use to source dependencies.

the pyshacl package is only used in one place in validators, but nonetheless it seems like that's intended to be an optional package available at runtime.

This PR changes it to be an extra, so one installs it like pip install linkml[shacl] (or poetry install -E shacl.

I also added it to a tests extra group, so that we might gradually work towards #1784 where all formats have their own extras group, and one can install everything like pip install linkml[all] or whatever, and we also can install for tests like pip install linkml[tests].

with this PR, the PKG-INFO has these extra lines:

Provides-Extra: shacl
Provides-Extra: tests
...
Requires-Dist: pyshacl (>=0.25.0,<0.26.0) ; extra == "shacl" or extra == "tests"

Caveats

This means that you need to do poetry install -E tests when installing (rather than just poetry install. this is imo a good thing, because it may gradually make it possible for people who do use poetry to install from the lockfile without needing to install all testing and docs dependencies if they don't want to.

@sneakers-the-rat sneakers-the-rat added the devops poetry, setuptools, actions, etc. related changes label Mar 19, 2024
Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.70%. Comparing base (b033087) to head (4f39443).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1992      +/-   ##
==========================================
+ Coverage   80.51%   80.70%   +0.18%     
==========================================
  Files         104      104              
  Lines       11620    11620              
  Branches     2909     2909              
==========================================
+ Hits         9356     9378      +22     
+ Misses       1717     1701      -16     
+ Partials      547      541       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmungall cmungall merged commit f76637b into main Mar 21, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops poetry, setuptools, actions, etc. related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants