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

use setuptools-scm for package version #18

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,12 @@ OD.*

# Beacon def formats
*xtce.xml

# MacOS
.DS_Store

# Vim
*.swp

# setuptools-scm
*/_version.py
12 changes: 11 additions & 1 deletion oresat_configs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@

from enum import IntEnum

__version__ = "0.3.1"
__all__ = [
"__version__",
"OreSatId",
"ORESAT_NICE_NAMES",
"NodeId",
]

try:
from ._version import version as __version__ # type: ignore
ThirteenFish marked this conversation as resolved.
Show resolved Hide resolved
except ImportError:
__version__ = "0.0.0" # package is not installed


class OreSatId(IntEnum):
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools"]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -33,15 +33,15 @@ oresat-print-od = "oresat_configs.scripts.print_od:print_od"
oresat-sdo-transfer = "oresat_configs.scripts.sdo_transfer:sdo_transfer"
oresat-gen-xtce = "oresat_configs.scripts.gen_xtce:gen_xtce"

[tool.setuptools.dynamic]
version = {attr = "oresat_configs.constants.__version__"}

[tool.setuptools.packages.find]
exclude = ["docs*", "tests*"]
exclude = ["docs*", "tests*"]

[tool.setuptools.package-data]
"*" = ["*.yaml", "*.csv"]

[tool.setuptools_scm]
write_to = "oresat_configs/_version.py"

[tool.black]
line_length = 100

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pylama[all]
pylama[toml]
pyyaml
setuptools
setuptools-scm
sphinx
sphinx-rtd-theme
wheel
Loading