Skip to content

Commit

Permalink
Remove tox, using pdm scripts instead (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesztman committed Mar 8, 2024
1 parent 864088f commit 87efdd5
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 193 deletions.
5 changes: 1 addition & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
"version": "20.11.1"
}
},
"postCreateCommand": "pdm sync -G dev && pdm run pre-commit install",
"containerEnv": {
"PDM_PYTHON": "${workspaceFolder}/.venv/bin/python"
},
"postCreateCommand": "pdm run pre-commit install --install-hooks && echo '\n📢📢 Call `pdm run all` to run all checks and tests, or use the provided test task from the VSCode command palette 📢📢'",
"customizations": {
"vscode": {
"extensions": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tox and publish release
name: Test and publish release

on:
push:
Expand All @@ -21,7 +21,6 @@ jobs:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
os:
- ubuntu-latest
- macos-latest
Expand All @@ -30,17 +29,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
- name: Install tox
with:
python-version: ${{ matrix.py }}
cache: true
- name: Run pdm script
run: |
pip install tox tox-pdm
- name: Run tox
run: tox
pdm run all
deploy:
runs-on: ubuntu-latest
Expand Down
11 changes: 0 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ repos:
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
exclude: ^tests/
additional_dependencies: [types-setuptools>=69.1.0.20240229]
- repo: https://github.com/Yelp/detect-secrets
rev: "v1.4.0"
hooks:
Expand All @@ -30,8 +24,3 @@ repos:
rev: 2.12.4
hooks:
- id: pdm-lock-check
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.352
hooks:
- id: pyright
additional_dependencies: [prettytable>=3.10.0]
25 changes: 25 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run tests",
"type": "shell",
"command": "pdm run all",
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Build package",
"type": "shell",
"command": "pdm build",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# get-py-deps
[![Tox and publish release](https://github.com/Wesztman/get-py-deps/actions/workflows/tox-and-publish.yml/badge.svg)](https://github.com/Wesztman/get-py-deps/actions/workflows/tox-and-publish.yml)
[![Test and publish release](https://github.com/Wesztman/get-py-deps/actions/workflows/test-and-publish.yml/badge.svg)](https://github.com/Wesztman/get-py-deps/actions/workflows/test-and-publish.yml)
[![PyPI Version](https://img.shields.io/pypi/v/get-py-deps.svg)](https://pypi.python.org/pypi/get-py-deps)
![Python Versions](https://img.shields.io/badge/Python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue
![Python Versions](https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12-blue
)
![Tested on OS](https://img.shields.io/badge/OS-win%20%7C%20linux%20%7C%20mac-orange)
[![License](https://img.shields.io/static/v1?label=license&message=MIT&color=success)](./LICENSE)
Expand Down Expand Up @@ -56,12 +56,18 @@ Development is easiest done using the provided dev container. This will ensure t

The dev container will install all development dependencies and set up the pre-commit hooks used in this project.

To ensure dependency consistency and easy testing, this project uses [PDM](https://pdm-project.org/latest/) and [tox](https://tox.readthedocs.io/en/latest/).
To ensure dependency consistency and easy testing, this project uses [PDM](https://pdm-project.org/latest/).

To run all tests and checks, simply run tox from the command line.
To run all tests and checks, simply run the supplied pdm script from the command line.

```bash
$ tox
$ pdm run all
```

For a full list of available commands, run:

```bash
$ pdm run -l
```

### Pre-requisites
Expand All @@ -74,7 +80,7 @@ $ tox

The GitHub Action workflow is set up to run the tests and checks on every push, pr and release.

It runs the tox workflow for all supported Python versions on windows, mac and linux.
It runs the `pdm run all` scrips for all supported Python versions on windows, mac and linux.

When creating a release from a tag (x.y.z), the workflow will also build and push the Python package to PyPi.

Expand Down
123 changes: 15 additions & 108 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 87efdd5

Please sign in to comment.