Display git-based version in swagger docs #1105
Merged
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.
Fixes #1092
Previously the
nmdc-server
package's version was hardcoded insetup.py
at0.1
. With these changes the version is determined automatically usingsetuptools_scm
. Usingsetuptools_scm
requires migrating from the legacysetup.py
-based build to usingpyproject.toml
. Since we weren't really doing anything particularly dynamic insetup.py
that conversion was pretty straightforward. Since the build process now relies on git state, the.git
directory is mounted during the Docker build.I also took the opportunity to get rid of
setup.cfg
as well. It was only holding configuration that could be moved elsewhere:isort
config is now inpyproject.toml
. Going forward I think it's good practice to put as much tooling configuration as possible inpyproject.toml
.flake8
was already being configured in bothsetup.cfg
andtox.ini
, so that's been consolidated intotox.ini
. Sadly they sort of refuse to supportpyproject.toml
; might be a good motiviation to switch to ruff at some point.mypy
says they supportpyproject.toml
but I found it to be buggy so I've moved that config to a separatemypy.ini
file for now.