Skip to content
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
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file


version: 2
updates:
- package-ecosystem: "uv"
directories:
- "/"
schedule:
interval: "weekly"
day: "sunday"
open-pull-requests-limit: 10
groups:
patch-updates:
applies-to: version-updates
patterns:
- "*"
update-types:
- "patch"
minor-updates:
applies-to: version-updates
patterns:
- "*"
update-types:
- "minor"

- package-ecosystem: "github-actions"
directories:
- "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
118 changes: 68 additions & 50 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,80 @@
name: Build

name: Test PyShEx
env:
UV_VERSION: "0.7.13"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
update-requirements:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: dschep/install-pipenv-action@v1
- name: Update requirements
run: |
python -m pip install --upgrade pip
pip install pipenv-to-requirements
pipenv lock
pipenv_to_requirements
git add requirements*.txt
if [[ -n $(git status -s requirements*.txt) ]]
then
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m 'Automatically generated requirements' requirements*.txt
git push
fi
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Install tox
run: python -m pip install tox
- name: Run codespell
run: tox -e codespell

test:
needs: update-requirements
name: Run TOX tests
runs-on: ubuntu-latest
needs:
- quality-checks
strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9, "3.10" ]
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
# Test on Windows with only the oldest and newest Python versions
# See https://github.com/snok/install-poetry#running-on-windows
defaults:
run:
shell: bash

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run TOX
env:
# Prevents conflicts during concurrent runs. Further
# configuration takes place in the tox.ini file.
COVERAGE_FILE: .coverage.${{matrix.python-version}}
run: |
echo "Generated by build process" > tests/data/SKIP_EXTERNAL_URLS
pip install tox
tox -e py

- uses: codecov/codecov-action@v3
with:
# files: ./coverage1.xml,./coverage2.xml # optional
# flags: unittests # optional
# name: codecov-umbrella # optional
# fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
uv sync --group dev

- name: Verify uv.lock is up-to-date
run: uv lock --check

- name: Generate coverage results
# Set bash shell to fail correctly on Windows https://github.com/actions/runner-images/issues/6668
shell: bash
run: |
uv run coverage run -m pytest
uv run coverage xml
uv run coverage report -m

- name: Upload coverage report
uses: codecov/codecov-action@v6.0.0
with:
name: codecov-results-${{ matrix.os }}-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: false
88 changes: 70 additions & 18 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,76 @@ on:
types: [created]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
build:
name: Build distributions 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Fetch full git tags
run: git fetch --tags

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Install Python 3.13
run: uv python install 3.13

- name: Build
run: uv build

- name: Upload dist artifact
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/


publish-testpypi:
name: Publish to TestPyPI
needs: build
if: github.event.release.prerelease == true
runs-on: ubuntu-latest

permissions:
id-token: write

environment: testpypi

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
- name: build a binary wheel dist
run: |
rm -fr dist
python setup.py bdist_wheel sdist

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@v1.2.2
- name: Download dist
uses: actions/download-artifact@v7
with:
name: dist
path: dist/

- name: Publish to TestPyPI 📦
uses: pypa/gh-action-pypi-publish@v1.14.0
with:
user: __token__
password: ${{ secrets.pypi_password }}
repository-url: https://test.pypi.org/legacy/


publish-pypi:
name: Publish to PyPI
needs: build
if: github.event.release.prerelease == false
runs-on: ubuntu-latest

permissions:
id-token: write

environment: pypi

steps:
- name: Download dist
uses: actions/download-artifact@v7
with:
name: dist
path: dist/

- name: Publish to PyPI 📦
uses: pypa/gh-action-pypi-publish@v1.14.0
20 changes: 0 additions & 20 deletions Pipfile

This file was deleted.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
This repository was originally developed by [Harold Solbrig](https://github.com/hsolbrig) and was kindly contributed
to the LinkML organization because of his retirement. All credit for the original development of this repository goes
to him.

# Special note
Since development was taken over after a long time of no development, there are tests that are not passing.
The reasons are not always immediately clear, in some cases it is due to code not having been updated when dependencies
updated their versions. In other cases, there are genuine bugs that have not been fixed. The current release was
released in order to be able to support Python 3.14 in LinkML. Please get in touch by opening an issue if you
encounter any bugs.

# Python implementation of ShEx 2.0
[![Pyversions](https://img.shields.io/pypi/pyversions/PyShEx.svg)](https://pypi.python.org/pypi/PyShEx)

Expand Down
Loading
Loading