-
Notifications
You must be signed in to change notification settings - Fork 18
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
Upgrade package and repo infrastructure #156
base: dev
Are you sure you want to change the base?
Conversation
Add PyCharm (`.idea`), MacOS (`.DS_Store`) and `_version.py`
To be replaced by `versioningit`
Remove `versioneer.py`. The manifest itself should not be included either.
`_version.py` will be automatically created by `versioningit` during build. See [cookiecutter docs](https://github.com/MolSSI/cookiecutter-cms#versioningit) for more detail.
Bump Python versions to 3.9, 3.10, 3.11
No need for `__init__` in tests folder when using `pytest`; but may confuse other tools.
See [official recommendation](https://packaging.python.org/en/latest/tutorials/packaging-projects/#creating-the-package-files) and [this issue](MolSSI/cookiecutter-cms#144)
See [PEP 561](https://peps.python.org/pep-0561/) and [cookiecutter](https://github.com/MolSSI/cookiecutter-cms)
…ned biopython version
`pylint` and `black` are already declared in `test_env.yaml` and are installed in the previous step
See new cookiecutter template
Current pins are only compatible with Python <= 3.8
Update Pylint config file to current version.
@dominiquesydow and @pipaj97 I tagged you both in the description above to potentially help to solve one of the issues related to your code bases. Please let us know if you have time to look at it? |
Hi @AndreaVolkamer, could you please point me to the OpenCADD-KLIFS problem you are referring to? |
@dominiquesydow: see Pylint checks here: https://github.com/volkamerlab/opencadd/actions/runs/4951193996/jobs/8855837341?pr=156 |
Thanks, @AndreaVolkamer, I am good with the |
Description
This PR upgrades the OpenCADD package and repository infrastructure, according to latest guidelines, standards, and software best practices.
Content
1. Upgrade build system (
setup.py
→pyproject.toml
)The packaging build system is upgraded in compliance with PEP 621:
pyproject.toml
.setup.py
is removed.setuptools
version is updated from<60
to>=61
.References:
2. Upgrade supported Python versions ([3.7, 3.8] → [3.9, 3.10, 3.11])
According to Python packaging guidelines (e.g. see conda-forge guidelines), package builds must be available for the current Python version (3.11), and (at least) two preceding minor versions (3.9 and 3.10).
New functionalities that are to be added to OpenCADD require at least Python 3.9, in compliance with the guidelines. Therefore, the supported Python versions were updated as follows:
pyproject.toml
.biopython
), which was preventing the new environments (with update Python versions) to solve.References:
3. Change versioning tool (
versioneer
→versioningit
)versioningit
is a modern alternative toversioneer
, which is now used as default in the new Cookiecutter-CMS template.It integrates well with
pyproject.toml
, is more straightforward to use and maintain, and has all the required functionalities.To replace
versioneer
withversioningit
:versioneer.py
andopencadd/_version.py
are removed, along with references inopencadd/__init__.py
,setup.cfg
andMANIFEST.in
.versioningit
configs are added inpyproject.toml
.opencadd.__version__
is referenced inopencadd/__init__.py
and.gitattributes
.References:
4. Upgrade GitHub Action workflows
windows-latest
is added to OS matrix for testing.provision-with-micromamba
is now used instead ofsetup-miniconda
. This is the default recommended Action used in the new Cookiecutter-CMS template, which usesmicromamba
instead ofconda
, which among others, has the advantage of being much faster (CI workflow now runs in less than half the time)..github/workflows/docs.yaml
) is merged into the CI as a new job, to reduce boilerplate, and increase maintainability.References
provision-with-micromamba
setup-miniconda
5. Organize repo structure
According to the PyPA guidelines, the directory for test files should be placed in the root directory of the repository, named
tests
. More importantly, it should not be placed inside the package directory, sinceTherefore, the tests folder was moved from within the package directory into the root, and all paths and imports were corrected accordingly.
References
6. Update
pylint
configurationsThe configurations for static code checking using
pylint
during the CI workflow are stored in the root, under.pylintrc
. The current configurations were incompatible with updatedpylint
versions based on the updated Python versions. Moreover, they were strictly limited, meaning most checking criteria were disabled. Therefore, the configuration file was replaced with the current up-to-date recommended version.References
7. Other small improvements
.gitignore
list: added PyCharm and MacOS-specific files, plus temporary_version.py
files that are built during build byversioningit
.Issues
Incompatible dependencies and failing unit-tests
After changing the supported Python versions from (3.7, 3.8) to (3.9, 3.10, 3.11), the CI workflow indicated that the current defined environment (in
devtools/conda-envs/test_env.yaml
) could not be solved with the new Python version specifications, due to the packagebiopython
being pinned at version<1.77
, which requires Python<=3.8
.Thus, the pin was removed from the environment file. As a result, OpenCADD can now be built and run on the three latest Python versions. However, eight of the test functions are now failing. As expected, most of them relate to functionalities using the
biopython
package. However, some functions related tommligner
are also failing (although it was not pinned before). Moreover, since the code coverage of the tests is not complete, there may be other functionalities that are failing as well.Incompatibility with Windows OS
Adding testing for Windows OS reveled that the current OpenCADD package is not compatible with Windows and cannot be installed, due to following Windows-incompatible dependencies, which are all used in
opencadd.structure.superposition
package:clustalo
,mmligner
,muscle
,theseus
.Errors due to Pylint configuration change
Investigating the CI workflow results after updating Pylint and its configuration revealed potential errors (see here), which were previously suppressed by the more restrictive analysis configurations of Pylint.
Status
All necessary changes to the package infrastructure and repository are successfully applied. The PR can be merged into the
dev
branch. However, before continuing and merging intomain
, a strategy to address the issues mentioned above should be discussed.