Skip to content

Commit

Permalink
Set up using PDM (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanluoyc authored Nov 7, 2023
1 parent 3fab0f6 commit ff22a66
Show file tree
Hide file tree
Showing 6 changed files with 1,418 additions and 88 deletions.
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

0 comments on commit ff22a66

Please sign in to comment.