Major Refactor, Dockerfile Changes, Unit Test Workflow, and Other Improvements #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request aims to modernize the project by updating it for newer versions of python, improving test coverage, reworking the Dockerfile, and a significant refactor of the code base. There is a decent amount of changes here, so let me know if there are any questions or feedback. Thanks!
Changes Made
a.
SemVer
class now lives within its own files atsemver.semver
and is not directly died into user input. Instead now, input from the CLI is passed to theSemVer
class where the core logic still remains.b. Upgrade to use
pyproject.toml
Eventually deprecatesetup.cfg
with automatic conversion topyproject.toml
pypa/setuptools#3214c. Move git specifics functionality to a
Git
class using aSCM
interface. This allows us to expand its functionality as needed. (I've considered adding Perforce support since its a popular SCM used in the gaming space.)d.
.bumpversion.toml
support in spirit with the general move totoml
going on for python build tools.e. Generally tried to move code into classes as much as possible in hopes of simplifying complexity. I think this is most visible with how both the main entrypoint and the
semver_get_version
have shared logic going non inSemVer
f. Improved test coverage with a preference to unit tests over integration tests. Lots of mocking going on and a
MockSCM
class was created to simplify testing without calling or needing to mock git commands.g. Formatting changes to better meet the PEP-8 guidelines.
h. Type hints and docstrings using the format used by Jetbrain's Pycharm.
a.
test
job runs the unit tests via pytest on a given matrix of . It's currently setup to run on Linux, Windows, and MacOS for every supported Python major version (as of July 22nd)b.
coverage
job is setup to gather the code coverage and comment a report on pull requests using https://github.com/MishaKav/pytest-coverage-commenta. Now uses a staged builder to create the wheels that are then copied to the final container. This avoids the final container containing unused files such as the
.gitignore
file orJenkinsfile
.b. Moved from CentOS container to Debain based slim python container.
Personal Message
Long time no see!
I want to acknowledge its been a while and I hope you are all doing well and thriving! Because I worked on auto-semver a lot during my time at RightBrain, I’ve wanted to update it to showcase as a portfolio piece. During my absence, I’ve gone through a lot of growth both personally and professionally. For those who remember me and wish to catch up, you’re welcome to reach out on LinkedIn or other social media.
Thank you for your time and support!
Warm regards,
Layla Manley