Skip to content

Commit

Permalink
Merge pull request #47 from GateNLP/develop
Browse files Browse the repository at this point in the history
Release 1.0.0 rc1
  • Loading branch information
freddyheppell authored Dec 18, 2024
2 parents cdc7f87 + f283ea1 commit 3210cab
Show file tree
Hide file tree
Showing 101 changed files with 9,145 additions and 2,638 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==1.8.3
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "poetry"
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install Project
run: poetry install --no-interaction
- name: Ruff Lint Format
run: poetry run ruff format --check
id: format
- name: Ruff Lint Check
run: poetry run ruff check --output-format=github
if: success() || steps.format.conclusion == 'failure'
111 changes: 111 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Push to PyPI

on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
build:
name: Build Distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==1.8.3
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "poetry"
- name: Install Python dependencies
run: poetry install --no-interaction --no-root
- name: Build
run: poetry build
- name: Store distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ultimate-sitemap-parser
permissions:
id-token: write
steps:
- name: Download distribution packages
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: GitHub release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

steps:
- name: Download distribution packages
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
publish-to-testpypi:
name: Publish to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/ultimate-sitemap-parser
permissions:
id-token: write
steps:
- name: Download distribution packages
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==1.8.3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install Project
run: poetry install --no-interaction
- name: Poetry Build
run: poetry build
- name: Run tests
run: poetry run pytest
43 changes: 43 additions & 0 deletions .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Integration Test

on: [workflow_dispatch]

permissions:
contents: read

jobs:
integ_test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8"]

steps:
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==1.8.3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install Project
run: poetry install --no-interaction
- name: Cache cassettes
uses: actions/cache@v4
with:
path: tests/integration/cassettes
# Always restore this cache as the script takes care of updating
key: usp-cassettes
- name: Download cassettes
run: poetry run python tests/integration/download.py -d
- name: Run integration tests
run: poetry run pytest --integration --durations=0 --junit-xml=integration.xml tests/integration/test_integration.py
- name: Upload report
uses: actions/upload-artifact@v4
with:
path: $GITHUB_SHA.xml
name: junit_report
69 changes: 3 additions & 66 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,70 +114,7 @@ dmypy.json
# Pyre type checker
.pyre/

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
.idea/

# Memray reports
memray/
4 changes: 0 additions & 4 deletions .idea/encodings.xml

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/mediacloud-ultimate_sitemap_parser.iml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

18 changes: 0 additions & 18 deletions .idea/runConfigurations/pytest_in_test_helpers_py.xml

This file was deleted.

18 changes: 0 additions & 18 deletions .idea/runConfigurations/pytest_in_test_tree_py.xml

This file was deleted.

Loading

0 comments on commit 3210cab

Please sign in to comment.