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 28588ce commit 470a4e7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is used for DatatableView

name: Django Datatable View Tests

on:
Expand Down Expand Up @@ -54,6 +52,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
25 changes: 8 additions & 17 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 = "django-datatable-view"
dynamic = ["version"]
description = "This package is used in conjunction with the jQuery plugin (http://http://datatables.net/), and supports state-saving detection with (http://datatables.net/plug-ins/api). The package consists of a class-based view, and a small collection of utilities for rendering table data from models."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11"
authors = [
{ name = "Pivotal Energy Solutions", email = "[email protected]" },
]
Expand All @@ -24,9 +24,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software 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 Down Expand Up @@ -58,7 +55,7 @@ Thanks = "https://saythanks.io/to/rh0dium"
Source = "https://github.com/pivotal-energy-solutions/django-datatable-view/"

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

[tool.hatch.build.targets.sdist]
include = [
Expand All @@ -78,17 +75,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 = ['datatableview', "demo_app"]
Expand Down

0 comments on commit 470a4e7

Please sign in to comment.