Skip to content

Commit

Permalink
chore: Update packaging process (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisBRENON authored May 15, 2024
1 parent 99db25e commit 325b269
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 191 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ jobs:
- name: Set up pip
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
- name: Install
run: pip install '.[testing]' 'urllib3<1.27'
- name: Test with pytest
run: python setup.py test
run: pytest

publish:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.event.ref, 'refs/tags/v')
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -38,13 +39,8 @@ jobs:
- name: Set up pip
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
- name: Install
run: pip install '.[releasing]'
pip install --upgrade hatch
- name: Build
run: python setup.py bdist_wheel
run: hatch build
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
uses: pypa/gh-action-pypi-publish@v1.8.14
5 changes: 0 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,5 @@ Take a look at the `technical documentation`_.
.. _GitHub: https://github.com/AlexisBRENON/ewmh_m2m
.. _technical documentation: https://ewmh-m2m.readthedocs.io/

Note
====

This project has been set up using PyScaffold 3.2.2. For details and usage
information on PyScaffold see https://pyscaffold.org/.

.. _move-to-next-monitor: https://github.com/jc00ke/move-to-next-monitor
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build]
packages = ["src/ewmh_m2m"]

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/ewmh_m2m/__init__.py"

[project]
dynamic = ["version"]
name = "ewmh_m2m"
authors = [
{ name="Alexis BRENON", email="brenon.alexis@gmail.com" },
]
description = "Move window between monitor in EWMH compliant WM"
readme = "README.rst"
license = {file = "LICENSE.txt"}
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
]
requires-python = ">=3.8"
dependencies = [
"xcffib==0.8.1",
"xpybutil==0.0.6"
]

[project.optional-dependencies]
testing = [ "pytest", "pytest-cov" ]

[project.urls]
Documentation = "https://ewmh-m2m.readthedocs.io"
Repository = "https://github.com/AlexisBRENON/ewmh_m2m"

[project.scripts]
move-to-monitor = "ewmh_m2m.__main__:main"


[tool.pytest.ini_options]
addopts = "--cov ewmh_m2m --cov-report term-missing --verbose"
norecursedirs = [
"dist",
"build",
".tox"
]
testpaths = ["tests"]
123 changes: 0 additions & 123 deletions setup.cfg

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

24 changes: 15 additions & 9 deletions src/ewmh_m2m/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# -*- coding: utf-8 -*-
import importlib.metadata
# file generated by setuptools_scm
# don't change, don't track in version control
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
VERSION_TUPLE = object

try:
# Change here if project is renamed and does not equal the package name
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError:
__version__ = 'unknown'
finally:
del importlib.metadata
version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '2.0.1.dev3+g99db25e.d20240514'
__version_tuple__ = version_tuple = (2, 0, 1, 'dev3', 'g99db25e.d20240514')

0 comments on commit 325b269

Please sign in to comment.