Closed oldfielj-ansto closed 1 year ago
The "Linting & Code Quality" action fails here due to the aforementioned Pre-Commit settings for Black, etc.
The "Coverage Report" action fails due to the repository GitHub action permissions as they are currently configured, this can be rectified without changing those settings by generating and providing the action with a new token that has sufficient permissions to comment on a PR.
An example of the what the "Coverage Report" action comment looks like can be found here. https://github.com/AustralianSynchrotron/mxcubecore/pull/3#issuecomment-1266292792
Thanks a lot @oldfielj-ansto for this very nice PR, It is very much appreciated :+1:
I like the idea of trying out Poetry
, I did actually consider it when we introduced bump2version
but did not have the time to investigate it enough. It seems to me to provide a more complete solution over setup.py
, I like the overview the pyproject.toml
gives and that it handles virtual environments (basically a must when working with Python)
Over all it looks like a good update of our current routines, I suspect that we might need to discuss what to do with the Flake8 warnings/errors. I think we should try to get as much of this as possible in place, perhaps excluding Flake8 to start with. Then come up with a plan on how to perform the necessary changes for Flake8, if we think it will bring us some additional value.
It is very good that someone is doing this. It will be painful to incorporate, but then taking your medicine always is.
Could I propose that someone runs the full black/flake8 on a separate branch and makes the linted branch and the linter report available to all of us? We could then look at the kind of changes that would await us, digest it, and then discuss what checks we might want to disable (if any, of course).
Looks great :) thanks !
Ill go a head and merge this, there might be some adjustments later on but it puts a lot of good things in place.
@marcus-oscarsson Cool OK, I'll need to raise another PR to fix an issue I've been troubleshooting with Python3.11.
Seems that the "gipc" package is failing to install as it is not yet compatible with the latest release of Gevent. Since it looks like this package is only used by sites requiring the "TangoLimaVideo" and "TangoLimaVideoLoopback" hardware objects, I should be able to lock it to Python3.10 and below, allowing sites not using these hardware objects to start experimenting with Python3.11.
I've also been playing around with the code quality / linting tool configs and have gotten the number of automatic refactors down to 112, which I think is a more manageable starting point than the 800+ we started with in this PR.
Just working on adjusting the Flake8 configuration to document what the warning being disabled are, and muting some of the more nuisance spam warnings.
@oldfielj-ansto. Ok I see. I had the same problem and simply pinned gevent to "21.12.0" which I think should work fine as well.
We will tune these things a bit as we go, I guess its the easiest way. Sounds great for the linting, 112 errors sounds manageable :),
This PR makes changes in several places, none of which impact the overall functionality of the MXCuBE Core package. These changes aren't meant to be merged in their current state, rather they are intended to start a discussion around package management tools, linting/code quality tools and package distribution.
Summary of Changes:
pip install mxcubecore
will work the same way as it always has.poetry build
andpoetry publish
, the build command will automatically build the sdist/wheel archives for distribution, the publish command will update a PyPi repository listing and upload the new version attaching the archives generated by the build command. This simplifies distribution overhead and opens up the opportunity to automate the entire process via GitHub actions.pre-commit run -a
.pre-commit install
and once installed these scripts will cause new commits to fail if Pre-Commit has not been run and the problems resolved, this generally acts as a final sanity check before trying to raise a PR and realising there is an issue at that point.pre-commit run -a
to run linting/code quality tools, essentially this is a check to tell the reviewer if the contributor has remembered to run these tools before submitting the PR.