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

Chore: version management #325

Merged
merged 2 commits into from
Sep 19, 2023
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
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__)