uwefladrich / scriptengine

A lightweight and extensible framework for execution scripts written in YAML.
GNU General Public License v3.0
15 stars 4 forks source link

Add and install optional/extra dependencies #90

Closed kinow closed 1 year ago

kinow commented 1 year ago

Hi,

I think this fixes #31

When running the IDE linter/inspection for #89 , I noticed it complained about pytest missing in my venv (when it scanned some test files).

Then I saw #31, and quickly put up together something that I think works for pyproject.toml and setup.*. I used an older version of Cylc to remember the old syntax and update the setup.py file. And used pyflow and some blog to update the pyproject.toml file.

I have Python 3.10, so to test it I did something like:

$ rm -rf venv && python -m venv venv && source venv/bin/activate
$ pip install -e .
# here we have scriptengine base deps
$ pip install -e .[tests]
$ # now we have pytest and any other test dependency
$ pip install -e .[all]
$ # now we have everything, including the Sphinx dependencies

Then, in order to test the setup.py file, kept for Python 3.6 compatibility, I tried the simplest approach I could think of :grimacing:

$ deactivate
$ rm -rf venv && python -m venv venv && source venv/bin/activate
$ mv pyproject.toml temp
$ # repeat tests

Cheers, Bruno

kinow commented 1 year ago

Edited the commit to update the GH Actions workflow and use the new dependency group. Added the coverage specific libraries to the tests group too, so users running it locally can choose to run tests and/or include coverage as well.

uwefladrich commented 1 year ago

Could you please rebase this PR onto the new master branch after fixing #89?

kinow commented 1 year ago

Could you please rebase this PR onto the new master branch after fixing #89?

Oh, sure, sorry, I forgot to do that when updating the PR. Done!

uwefladrich commented 1 year ago

Great! This is something that I meant to do for quite a while but never found the time to learn! Thanks a lot for the contribution!

kinow commented 1 year ago

Great! This is something that I meant to do for quite a while but never found the time to learn! Thanks a lot for the contribution!

Not a problem. Consider it a payback for sharing SE as Open Source and with great docs and tests 🙂 thank you for that too!