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

Switch build to hatch, build wheel in CI #60

Merged
merged 4 commits into from
Jun 23, 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
35 changes: 30 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
matrix:
include:
- python-version: "3.7"
- python-version: "3.8"
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
steps:
- uses: actions/checkout@v3
Expand All @@ -48,13 +45,41 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
cache-dependency-path: |
infotv/frontend/package.json
infotv/frontend/yarn.lock
- run: yarn --frozen-lockfile
working-directory: ./infotv/frontend
- run: yarn lint
working-directory: ./infotv/frontend
- run: yarn build
working-directory: ./infotv/frontend
env:
NODE_OPTIONS: --openssl-legacy-provider
- run: yarn test
working-directory: ./infotv/frontend
- uses: actions/upload-artifact@v3
with:
name: infotv-static
path: ./infotv/static

Build-Wheel:
needs:
- JavaScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
- uses: actions/download-artifact@v2
with:
name: infotv-static
path: infotv/static
- run: pip install build
- run: python -m build .
- run: zipinfo dist/*.whl | grep static/infotv/bundle.js || exit 42
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist
1 change: 1 addition & 0 deletions infotv/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.5.0"
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "infotv"
dynamic = ["version"]
description = "A television, with information"
readme = "README.md"
license = "MIT"
requires-python = ">=3.7"
authors = [
{ name = "Kehittyvien conien Suomi ry" },
{ name = "Aarni Koskela", email = "akx@iki.fi" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
]
dependencies = [
"Django>=3.2",
"jsonfield>=1.0.3",
"requests>=2.13.0",
]

[project.urls]
Homepage = "https://github.com/kcsry/infotv"

[tool.hatch.version]
path = "infotv/__init__.py"

[tool.hatch.build]
artifacts = [
"infotv/static",
]

[tool.hatch.build.targets.sdist]
include = [
"/infotv",
]
exclude = [
"/infotv/static/infotv",
]

[tool.hatch.build.targets.wheel]
exclude = [
"infotv/frontend",
]

[tool.ruff]
target-version = "py37"
line-length = 120
Expand All @@ -23,3 +72,7 @@ ignore = [

[tool.ruff.per-file-ignores]
"infotv_test/**" = ["ANN"]

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "infotv_test.settings"
norecursedirs = ["bower_components", "node_modules", ".git", "venv", "site-packages"]
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py37-django32
py3{8,9,10,11}-django{40,41}
py3{8,9,10,11}-django{40,41,42}

[gh-actions]
python =
Expand All @@ -21,3 +21,4 @@ deps =
django32: Django~=3.2.0
django40: Django~=4.0.0
django41: Django~=4.1.0
django42: Django~=4.2.0