Migrate to hatchling and migrate CI to GitHub actions#527
Conversation
|
I could fix the linter in one commit if wanted. And I would propose to use Black to not have any discussions around styling in the future. Most big projects are now moving towards that. e.g. Scikit-learn is using it. |
|
@ofek could you have a quick look at the Hatchling config? This project is using a src layout and for some reason I cannot manage to properly import the package (I am installing with And another question, does it make sense to test the wheel? Or you think there is no reason to do so compared to just testing after doing |
|
Oh I got it to work doing |
Co-authored-by: Ofek Lev <ofekmeister@gmail.com>
|
I did not try to build before that, I was just installing with |
|
Oh wow you discovered a bug: I'll fix tonight |
Yay glad I can help 😃 |
|
@willu47 @ConnectedSystems this is ready to be reviewed. The commit |
|
Please remove the explicit |
|
Thank you @ofek for the fast update of Hatchling! It works just fine now. I tested locally and in the CI here. Thank you for having a look at this configuration and helping out. |
|
Happy to help! |
willu47
left a comment
There was a problem hiding this comment.
Thanks for updating the CI and CD steps.
Please could you ensure that the developer documentation in CONTRIBUTING.md is also updated to reflect the new CI/CD procedures? (note @ConnectedSystems should be listed as an admin there as well).
It would also be useful to record the steps required to create a release (I believe I wrote this up in an issue or PR a long time ago!).
| [project] | ||
| name = "SALib" | ||
| dynamic = ["version"] | ||
| description = "Tools for sensitivity analysis. Contains Sobol', Morris, and FAST methods" |
There was a problem hiding this comment.
Update the description with the complete list of methods provided. Add 'global' in front of 'sensitivity analysis'
| license = "MIT" | ||
| authors = [ | ||
| { name = "Jon Herman", email = "jdherman8@gmail.com" }, | ||
| { name = "Will Usher" }, |
| { name = "Will Usher" }, | ||
| ] | ||
| maintainers = [ | ||
| { name = "SALib contributors" }, |
There was a problem hiding this comment.
Should we be more specific here and take the list from github?
There was a problem hiding this comment.
I would not really advise for it as it's a lot of additional maintenance. I think there are bots that could help do things like these. But usually projects care more about updating the release notes and have all the folks there. I suggest doing this elsewhere in any case as this PR is already packed with a lot of things.
|
Thank you for the review @willu47! I did the updates. For the documentation, I did already update the install instructions and added a section about creating an env with SALib installed in dev mode. For the release process (then this should close #355), I added the steps at the end of the contributing doc following the last comment of the issue and adapting it slightly for this PR. In general, I do think that the general structure and text could be updated. Though, I would suggest to separate theses changes and have them over #523 where I started to update the theme (which is ready on my side and needs inputs). |
|
Hi @tupui Tried to do a local install and test run and found these two issues:
I'll carve out some time during the week to look into it if you don't get to it first. An example of one of the test errors: Traceback:
..\..\..\miniconda3\envs\salib\lib\importlib\__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests\test_sample_seed.py:5: in <module>
from SALib.sample.morris import sample as morris_sampler
src\SALib\sample\morris\__init__.py:1: in <module>
from .local import LocalOptimisation # noqa: F401
src\SALib\sample\morris\local.py:7: in <module>
from .strategy import Strategy
src\SALib\sample\morris\strategy.py:16: in <module>
from scipy.spatial.distance import cdist # type: ignore
[... snip ...]
ImportError: cannot import name '_iterative' from partially initialized module 'scipy.sparse.linalg.isolve'
(most likely due to a circular import)
(C:\[path to SALib environment]\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py) |
|
Interesting I don't recall having issues there, and the CI is passing just fine. I would suspect an issue with your env and maybe try from scratch following what is done in the CI. I will try to reproduce on Monday. Since we are using conda, there is no reason to me to use |
|
Okay, this is a weird one. I run into an ImportError with SciPy due to a circular dependency This is a fresh environment but will retry with another one. And maybe again on Linux, given the tests pass. |
|
Sounds like your env is corrupted. Although from the traceback I am not sure if Your PYTHONPATH is empty right? |
|
False alarm - all working now. Had to recreate the environment again after manually deleting the environment folder but its working now. |
|
Great, let me know if there is more to do here 😃 |
Update specification of triangular distributions to latest three-valued version. Specify `dtype=object` when creating numpy array via a list of lists
|
All looks good to me so am merging now. Thanks to all who took part, and again to @ofek for dropping by and helping out! |

Closes #524 and closes #355
This does 2 things:
#519 and #522 would need to be slightly adapted depending on which PR gets in first.
Also, PyPi secrets would need to be added to the repo for deploying.
I simplified the version handling as well. I don't think there is a need to complicate this more. Also note that this is more or less for legacy use as the new way to check that is to rely on package's metadata.