Skip to content

Commit

Permalink
Chore: version management (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Sep 19, 2023
2 parents 1730445 + 35c552b commit f2c82df
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
8 changes: 6 additions & 2 deletions eligibility_server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
__version__ = "2023.08.2"
from importlib.metadata import version, PackageNotFoundError

VERSION = __version__
try:
__version__ = version("eligibility-server")
except PackageNotFoundError:
# package is not installed
pass
22 changes: 10 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
[build-system]
requires = ["setuptools>=65", "wheel"]
build-backend = "setuptools.build_meta"

[project]
classifiers = ["Programming Language :: Python :: 3 :: Only"]
name = "eligibility-server"
version = "2023.09.1"
description = "Server implementation of the Eligibility Verification API"
readme = "README.md"
license = { file = "LICENSE" }
classifiers = ["Programming Language :: Python :: 3 :: Only"]
requires-python = ">=3.9"
dependencies = [
"eligibility-api==2023.9.1",
"Flask==2.3.3",
"Flask-RESTful==0.3.10",
"Flask-SQLAlchemy==3.1.1",
"requests==2.31.0"
]
dynamic = ["version"]
keywords = ["flask"]
license = { file = "LICENSE" }
name = "eligibility-server"
readme = "README.md"
requires-python = ">=3.9"

[project.optional-dependencies]
dev = [
Expand All @@ -36,7 +31,10 @@ Code = "https://github.com/cal-itp/eligibility-server"
Documentation = "https://docs.calitp.org/eligibility-server"
Issues = "https://github.com/cal-itp/eligibility-server/issues"

# Configuration for black
[build-system]
requires = ["setuptools>=65", "wheel"]
build-backend = "setuptools.build_meta"

[tool.black]
line-length = 127
target-version = ['py310']
Expand Down
8 changes: 8 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test app
"""
import re

from eligibility_server.settings import APP_NAME
from eligibility_server.keypair import get_server_public_key
Expand Down Expand Up @@ -31,3 +32,10 @@ def test_publickey(client):
assert response.status_code == 200
assert response.mimetype == "text/plain"
assert response.text == get_server_public_key().decode("utf-8")


def test_version():
from eligibility_server import __version__

assert __version__ is not None
assert re.match(r"\d{4}\.\d{1,2}\.\d+", __version__)

0 comments on commit f2c82df

Please sign in to comment.