Adjust how the version is specified#565
Conversation
for building the docs.
This is ta allow the version to be dynamic, and easier to define in a single location.
welp, just became my own todo, got it! 🤣 |
Also add cspell configuration and correct spelling in README.md
b4801b1 to
a7c7e1d
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #565 +/- ##
==========================================
+ Coverage 69.42% 69.45% +0.03%
==========================================
Files 63 63
Lines 4285 4273 -12
==========================================
- Hits 2975 2968 -7
+ Misses 1310 1305 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the project's packaging approach by migrating from a traditional setup.py to a modern pyproject.toml configuration with dynamic versioning. The changes also introduce spell checking capabilities using cspell.
- Migration from
setup.pytopyproject.tomlfor project configuration - Implementation of dynamic versioning using environment variables instead of
importlib.metadata - Addition of cspell configuration for automated spell checking
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Completely removed the traditional setup configuration |
| pyproject.toml | New modern project configuration with dynamic versioning |
| fre/init.py | Simplified version handling using environment variables |
| docs/conf.py | Updated to use dynamic copyright year and package version |
| docs/Makefile | Changed source directory from 'source' to '.' |
| README.md | Fixed various spelling errors in documentation |
| .github/workflows/spell_check.yml | Added GitHub workflow for automated spell checking |
| .cspell/noaa-words.txt | Custom dictionary for NOAA-specific terms |
| .cspell/conda-words.txt | Custom dictionary for conda-related terms |
| .cspell.json | Main cspell configuration file |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
this is about ready. the spell check workflow is allowed to fail (for now). i think we should merge this and see what if any other issues come out of the cracks, and we put an agent on spelling errors |
Overviewmakes significant changes to how version information is handled in the Key Changes
Code AnalysisVersion ManagementThe approach to version management has been completely refactored: # Before (fre/__init__.py)
import importlib.metadata
# versioning, turn xxxx.y into xxxx.0y
version_unexpanded = importlib.metadata.version('fre-cli')
# ... complex string manipulation ...
# After (fre/__init__.py)
import os
version = os.getenv("GIT_DESCRIBE_TAG", "2025.04")
__version__ = versionThis is more straightforward and relies on environment variables, which is a common pattern in modern Python projects. The default fallback maintains compatibility. Package ConfigurationMoving from [build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "fre-cli"
# ...
dynamic = [
"version",
]
[tool.setuptools.dynamic]
version = {attr = "fre.__version__"}The |
|
... gonna do it! |
This is an idea on how to use pyproject.toml and a dynamic version number. I did not run any real tests, as I don't have a good build environment set up. I'll leave that to someone else.
This also now has a configuration for cspell.