Skip to content
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

Display git-based version in swagger docs #1105

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

pkalita-lbl
Copy link
Collaborator

Fixes #1092

Previously the nmdc-server package's version was hardcoded in setup.py at 0.1. With these changes the version is determined automatically using setuptools_scm. Using setuptools_scm requires migrating from the legacy setup.py-based build to using pyproject.toml. Since we weren't really doing anything particularly dynamic in setup.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 in pyproject.toml. Going forward I think it's good practice to put as much tooling configuration as possible in pyproject.toml.
  • flake8 was already being configured in both setup.cfg and tox.ini, so that's been consolidated into tox.ini. Sadly they sort of refuse to support pyproject.toml; might be a good motiviation to switch to ruff at some point.
  • mypy says they support pyproject.toml but I found it to be buggy so I've moved that config to a separate mypy.ini file for now.

Copy link
Collaborator

@naglepuff naglepuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Welcome to the future, nmdc-server!

@pkalita-lbl pkalita-lbl merged commit 069b632 into main Jan 9, 2024
2 checks passed
@pkalita-lbl pkalita-lbl deleted the issue-1092-version-display branch January 9, 2024 23:45
@eecavanna
Copy link
Collaborator

Awesome! Thanks for implementing this! (I just noticed this PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Swagger UI to display application version identifier
3 participants