Skip to content

Commit

Permalink
migrate package build system
Browse files Browse the repository at this point in the history
  • Loading branch information
wenh06 committed Sep 9, 2024
1 parent bc3e531 commit 15e2344
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ jobs:
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip setuptools wheel build
pip install -r requirements.txt
- name: Install Hatch
uses: pypa/hatch@install
- name: List installed Python packages
run: |
python -m pip list
- name: Build
run: |
python setup.py sdist bdist_wheel
python -m build
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
Expand All @@ -34,7 +34,7 @@ jobs:
python -m pip freeze
- name: Run test with pytest and collect coverage
run: |
pytest --cov=sphinx_emoji_favicon -v -s test
pytest --cov=sphinx_emoji_favicon -vv -s test
- name: Upload coverage to Codecov
if: matrix.python-version == '3.10'
uses: codecov/codecov-action@v4
Expand Down
54 changes: 54 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "sphinx-emoji-favicon"
dynamic = ["version"]
description = "A simple sphinx extension to add emoji favicons to html pages."
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.7"
authors = [
{ name = "DeepPSP", email = "[email protected]" },
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"docutils",
"emoji",
"requests",
"sphinx",
]

[project.optional-dependencies]
dev = [
"emoji",
"sphinx-favicon",
"tqdm",
]
test = [
"emoji",
"sphinx-favicon",
"tqdm",
]

[project.urls]
Homepage = "https://github.com/DeepPSP/sphinx-emoji-favicon"

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

[tool.hatch.build.targets.sdist]
include = [
"/sphinx_emoji_favicon",
]

0 comments on commit 15e2344

Please sign in to comment.