Skip to content

Commit f3c5543

Browse files
committed
chore: Update packaging process
1 parent 99db25e commit f3c5543

File tree

6 files changed

+73
-191
lines changed

6 files changed

+73
-191
lines changed

.github/workflows/python.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ jobs:
1919
- name: Set up pip
2020
run: |
2121
python -m pip install --upgrade pip
22-
pip install --upgrade setuptools wheel
2322
- name: Install
2423
run: pip install '.[testing]' 'urllib3<1.27'
2524
- name: Test with pytest
26-
run: python setup.py test
25+
run: pytest
2726

2827
publish:
2928
runs-on: ubuntu-latest
3029
needs: test
3130
if: startsWith(github.event.ref, 'refs/tags/v')
31+
permissions:
32+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
3233
steps:
3334
- uses: actions/checkout@v4
3435
- name: Set up Python
@@ -38,13 +39,8 @@ jobs:
3839
- name: Set up pip
3940
run: |
4041
python -m pip install --upgrade pip
41-
pip install --upgrade setuptools wheel
42-
- name: Install
43-
run: pip install '.[releasing]'
42+
pip install --upgrade hatch
4443
- name: Build
45-
run: python setup.py bdist_wheel
44+
run: hatch build
4645
- name: Publish
47-
env:
48-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
49-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
50-
run: twine upload dist/*
46+
uses: pypa/gh-action-pypi-publish@v1.8.14

README.rst

-5
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,5 @@ Take a look at the `technical documentation`_.
6767
.. _GitHub: https://github.com/AlexisBRENON/ewmh_m2m
6868
.. _technical documentation: https://ewmh-m2m.readthedocs.io/
6969

70-
Note
71-
====
72-
73-
This project has been set up using PyScaffold 3.2.2. For details and usage
74-
information on PyScaffold see https://pyscaffold.org/.
7570

7671
.. _move-to-next-monitor: https://github.com/jc00ke/move-to-next-monitor

pyproject.toml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[tool.hatch.build]
6+
packages = ["src/ewmh_m2m"]
7+
8+
[tool.hatch.version]
9+
source = "vcs"
10+
11+
[tool.hatch.build.hooks.vcs]
12+
version-file = "src/ewmh_m2m/__init__.py"
13+
14+
[project]
15+
dynamic = ["version"]
16+
name = "ewmh_m2m"
17+
authors = [
18+
{ name="Alexis BRENON", email="brenon.alexis@gmail.com" },
19+
]
20+
description = "Move window between monitor in EWMH compliant WM"
21+
readme = "README.rst"
22+
license = {file = "LICENSE.txt"}
23+
classifiers = [
24+
"Programming Language :: Python :: 3",
25+
"License :: OSI Approved :: MIT License",
26+
"Development Status :: 5 - Production/Stable",
27+
]
28+
requires-python = ">=3.8"
29+
dependencies = [
30+
"xcffib==0.8.1",
31+
"xpybutil==0.0.6"
32+
]
33+
34+
[project.optional-dependencies]
35+
testing = [ "pytest", "pytest-cov" ]
36+
37+
[project.urls]
38+
Documentation = "https://ewmh-m2m.readthedocs.io"
39+
Repository = "https://github.com/AlexisBRENON/ewmh_m2m"
40+
41+
[project.scripts]
42+
move-to-monitor = "ewmh_m2m.__main__:main"
43+
44+
45+
[tool.pytest.ini_options]
46+
addopts = "--cov ewmh_m2m --cov-report term-missing --verbose"
47+
norecursedirs = [
48+
"dist",
49+
"build",
50+
".tox"
51+
]
52+
testpaths = ["tests"]

setup.cfg

-123
This file was deleted.

setup.py

-44
This file was deleted.

src/ewmh_m2m/__init__.py

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# -*- coding: utf-8 -*-
2-
import importlib.metadata
1+
# file generated by setuptools_scm
2+
# don't change, don't track in version control
3+
TYPE_CHECKING = False
4+
if TYPE_CHECKING:
5+
from typing import Tuple, Union
6+
VERSION_TUPLE = Tuple[Union[int, str], ...]
7+
else:
8+
VERSION_TUPLE = object
39

4-
try:
5-
# Change here if project is renamed and does not equal the package name
6-
__version__ = importlib.metadata.version(__name__)
7-
except importlib.metadata.PackageNotFoundError:
8-
__version__ = 'unknown'
9-
finally:
10-
del importlib.metadata
10+
version: str
11+
__version__: str
12+
__version_tuple__: VERSION_TUPLE
13+
version_tuple: VERSION_TUPLE
14+
15+
__version__ = version = '2.0.1.dev3+g99db25e.d20240514'
16+
__version_tuple__ = version_tuple = (2, 0, 1, 'dev3', 'g99db25e.d20240514')

0 commit comments

Comments
 (0)