Closed eivindjahren closed 2 years ago
Thanks for making this PR, @eivindjahren. The changes looks good. I'm still going to need to see how this change affects packaging, but in any case, it's probably about time to refresh the packaging system (and upgrade to pyproject.toml) as well, to align the release procedure with rope.
@lieryan, thanks for merging! As for packaging, I usually automated it like this: https://github.com/equinor/ecl-data-io/blob/main/.github/workflows/publish_to_pypi.yml and use setuptools_scm
like this: https://github.com/equinor/ecl-data-io/blob/5b5e1b75a75979cc5e9ac34d6cc27a5e8d1fa5c3/setup.py#L15 . That way, releasing new versions to pypi can be done by just creating a release on github (Using this, the workflow only runs when that system is used to create a tag and release). No manual tagging, version bumping, package building or package upload required, although it can still be done manually if needed. Feel free to ask if that is something you are interested in.
Main goal of the PR is to add a github action that runs the tests via pytest in order to
1) have one command that runs all the tests 2) Run the tests on pull requests 3) Use pytest which is also used by rope.
In order to do so the pytest recommended practices for package layout is used. Specifically the one described by Ionel Cristian Mărieș. There are two forms of layouts that pytest suggests, and this one seems the most flexible and widely adopted (also many projects have changed to it because it solves so many problems).
Because changing the layout entailed ropemode is not available at setup time. The short description and version is duplicated. The duplication of the version string can be mitigated by using
setuptools_scm
but that requires changing the tagging scheme to semver.