Skip to content

Commit

Permalink
Switch build to use hatch
Browse files Browse the repository at this point in the history
Drops poetry support and instead uses hatch to build wheels. Developers
can easily hack on the project using a virtual environment as described
in the README.md

Closes #6

Signed-off-by: Joshua Watt <[email protected]>
  • Loading branch information
JPEWdev committed Mar 22, 2024
1 parent 50a4fab commit 3715474
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 238 deletions.
43 changes: 25 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: ci
---
name: Test bmaptool

on:
push:
Expand All @@ -10,25 +11,31 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]

python-version:
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
# Installs compression deps
sudo apt-get install -y pbzip2 pigz lzop liblz4-tool libgpgme11-dev
# Installs poetry
curl -sSL https://install.python-poetry.org | python3 -
poetry install -n
- name: Run tests
run: poetry run python -m unittest -bv
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -y pbzip2 pigz lzop liblz4-tool libgpgme11-dev
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Install package
run: |
pip install -e .[dev]
- name: Run tests
run: |
python -m unittest -vb
lint:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ docs/_build/

# virtualenv
venv/
.venv/
ENV/

#vscode
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,28 @@ $ cat /sys/module/zfs/parameters/zfs_dmu_offset_next_sync
More details can be found [in the OpenZFS documentation](https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Module%20Parameters.html).
## Hacking
`bmaptool` uses `hatch` to build python packages. If you would like to make
changes to the project, first create a new virtual environment and activate it:
```bash
python3 -m venv .venv
. .venv/bin/activate
```
Next install the project in editable mode with development dependencies:
```bash
pip install -m .[dev]
```
Finally, to run tests use `unittest`:
```bash
python3 -m unittest -bv
```
## Project and maintainer
The bmaptool project implements bmap-related tools and API modules. The
Expand Down
158 changes: 0 additions & 158 deletions poetry.lock

This file was deleted.

54 changes: 40 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
[tool.poetry]
[project]
name = "bmaptool"
version = "3.7.0"
license = "GPL-2.0-only"
description = "BMAP tools"
authors = ["Trevor Woerner <[email protected]>"]
dynamic = ["version"]
dependencies = [
"six >= 1.16.0",
"gpg >= 1.10.0",
]
required-python = ">= 3.8"
authors = [
{name = "Joshua Watt", email = "[email protected]"},
{name = "Trevor Woerner", email = "[email protected]"},
{name = "Tim Orling", email = "[email protected]"},

[tool.poetry.dependencies]
python = "^3.8"
six = "^1.16.0"
gpg = "^1.10.0"
]
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Embedded Systems",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]

[tool.poetry.dev-dependencies]
black = "^22.3.0"
nose = "^1.3.7"
[project.optional-dependencies]
dev = [
"black >= 22.3.0",
"nose >= 1.3.7",
]

[tool.poetry.scripts]
[project.urls]
Homepage = "https://github.com/yoctoproject/bmaptool"
Repository = "https://github.com/yoctoproject/bmaptool.git"
Issues = "https://github.com/yoctoproject/bmaptool/issues"

[project.scripts]
bmaptool = "bmaptool.CLI:main"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "src/bmaptool/CLI.py"
4 changes: 0 additions & 4 deletions requirements-test.txt

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

0 comments on commit 3715474

Please sign in to comment.