Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up using PDM #16

Merged
merged 4 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .github/workflows/publish.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Upload to PyPI

on:
push:
tags:
- "*"

env:
FORCE_COLOR: "1"

jobs:
deployment:
environment: pypi-publish
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- name: Check prerelease
id: check_version
run: |
if [[ "${{ github.ref }}" =~ ^refs/tags/[0-9.]+$ ]]; then
echo "PRERELEASE=false" >> $GITHUB_OUTPUT
else
echo "PRERELEASE=true" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Build artifacts
run: |
python -m pip install build
python -m build

- name: Setup PDM
uses: pdm-project/setup-pdm@v3

- name: Test Build
run: |
python -m pip install dist/*.whl
lxm3 version

- name: Publish package distributions to PyPI
run: pdm publish --no-build
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: test

on:
push:
branches:
- main
- develop
pull_request:
push:
branches:
- main

Expand Down Expand Up @@ -36,12 +33,15 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install Hatch
run: pip install --upgrade hatch
- name: Install PDM
run: python -m pip install pdm

- name: Install dependencies
run: pdm install

- if: matrix.python-version == '3.9' && runner.os == 'Linux'
- if: matrix.python-version == '3.10' && runner.os == 'Linux'
name: Lint
run: hatch run lint:all
run: pdm run lint

- name: Run tests
run: hatch run test
run: pdm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ ipython_config.py
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
.pdm-python

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand Down
Loading