Skip to content

Commit

Permalink
Merge pull request #9 from hnez/pyproject-toml
Browse files Browse the repository at this point in the history
Move the project away from setup.py to pyproject.toml
  • Loading branch information
SmithChart committed Mar 20, 2024
2 parents 3dfab51 + 2009530 commit 98b7729
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 158 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Build

on: [push, pull_request]

jobs:
build:
name: Source Distribution and Wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make build
- uses: actions/upload-artifact@v4
with:
path: dist
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@ PYTHON_TESTING_ENV=$(PYTHON_ENV_ROOT)/$(PYTHON)-qa-env
.PHONY: clean

# packaging environment #######################################################
$(PYTHON_PACKAGING_VENV)/.created: REQUIREMENTS.packaging.txt
$(PYTHON_PACKAGING_VENV)/.created:
rm -rf $(PYTHON_PACKAGING_VENV) && \
$(PYTHON) -m venv $(PYTHON_PACKAGING_VENV) && \
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
pip install --upgrade pip && \
pip install -r REQUIREMENTS.packaging.txt
python3 -m pip install --upgrade pip && \
python3 -m pip install build twine && \
date > $(PYTHON_PACKAGING_VENV)/.created

.PHONY: packaging-env build _release

packaging-env: $(PYTHON_PACKAGING_VENV)/.created

sdist: packaging-env
build: packaging-env
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
rm -rf dist *.egg-info && \
./setup.py sdist
python3 -m build

_release: sdist
_release: build
. $(PYTHON_PACKAGING_VENV)/bin/activate && \
twine upload dist/*


# helper ######################################################################
clean:
rm -rf $(PYTHON_ENV_ROOT)
Expand Down
2 changes: 0 additions & 2 deletions REQUIREMENTS.packaging.txt

This file was deleted.

2 changes: 0 additions & 2 deletions REQUIREMENTS.txt

This file was deleted.

110 changes: 0 additions & 110 deletions fastentrypoints.py

This file was deleted.

40 changes: 38 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "usbmuxctl"
description = "Tool to control an USB-Mux from the command line"
version = "0.1.3"
authors = [
{ name = "Chris Fiege", email = "[email protected]" },
]
readme = "README.rst"
license = { "text" = "LGPL-2.1-or-later" }
dependencies = [
"pyusb",
"termcolor"
]
classifiers = [
"Environment :: Console",
"Natural Language :: English",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only"
]

[project.urls]
homepage="https://github.com/linux-automation/usbmuxctl"
documentation="https://linux-automation.com/umx-M01/"

[project.scripts]
usbmuxctl = "usbmuxctl.__main__:main"

[tool.setuptools]
packages = [
"usbmuxctl",
"usbmuxctl.firmware"
]
include-package-data = true

[tool.ruff]
line-length = 119
exclude = [
"fastentrypoints.py",
"__pycache__",
"usbmuxctl.egg-info",
".pybuild",
"build",
"debian",
"env",
"venv",
"setup.py",
"envs",
"dist",
]
Expand Down
7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

29 changes: 0 additions & 29 deletions setup.py

This file was deleted.

0 comments on commit 98b7729

Please sign in to comment.