Skip to content

Commit

Permalink
Use hatch-vcs to figure out what version this thing has. We still upd…
Browse files Browse the repository at this point in the history
…ate the version file on deploy but now we can do pip install @Branch and it will update correctly

Signed-off-by: Steven K <[email protected]>
  • Loading branch information
rh0dium committed Jun 29, 2024
1 parent 1bc7775 commit 707a539
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ jobs:
- name: Black
run: black --check .

ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install .[test]
- name: Ruff
run: ruff check

pre-commit:
name: Pre-Commit
runs-on: ubuntu-latest
Expand Down
27 changes: 8 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "pivotal-app-metrics"
dynamic = ["version"]
description = "django-app-metrics is a reusable Django application for tracking and emailing application metrics."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11"
authors = [
{ name = "Pivotal Energy Solutions", email = "[email protected]" },
]
Expand All @@ -26,9 +26,6 @@ classifiers = [
"License :: Other/Proprietary License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Utilities",
Expand All @@ -43,7 +40,6 @@ test = [
"django-environ",
"mysqlclient",
"flake8",
"tox",
"coverage",
"pre-commit",
"black",
Expand All @@ -52,13 +48,12 @@ test = [

[project.urls]
Issues = "https://github.com/pivotal-energy-solutions/django-app-metrics/issues"
Download = "https://github.com/pivotal-energy-solutions/django-app-metrics/archive/4.0.4.tar.gz"
Homepage = "https://github.com/pivotal-energy-solutions/django-app-metrics"
Thanks = "https://saythanks.io/to/rh0dium"
"Original Source" = "https://github.com/frankwiles/django-app-metrics"

[tool.hatch.version]
path = "app_metrics/__init__.py"
source = "vcs"

[tool.hatch.build.targets.sdist]
include = [
Expand All @@ -77,17 +72,11 @@ include = [
line-length = 100
target-version = ['py311']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| \.venv
| _build
| build
| dist
)/
'''
exclude = '(\.git|.venv|_build|build|dist|.*\/__pycache__\/)'

[tool.ruff]
line-length = 100
lint.ignore = ["F401"]

[tool.bandit]
targets = ['app_metrics']
Expand Down

0 comments on commit 707a539

Please sign in to comment.