-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
440 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main, develop ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main, develop ] | ||
schedule: | ||
- cron: '34 21 * * 1' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# Learn more: | ||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This workflow will upload a Python Package when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
# normal behavior: run when a new release is created | ||
release: | ||
types: [published] | ||
# allow running manually on main | ||
workflow_dispatch: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/project/viapy/ | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: unit tests | ||
|
||
on: | ||
push: # run on every push or PR to any branch | ||
pull_request: | ||
schedule: # run automatically on main branch each Tuesday at 11am | ||
- cron: "0 16 * * 2" | ||
|
||
jobs: | ||
python-unit: | ||
name: Python unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: ["3.9", "3.10", "3.11", "3.12"] | ||
django: [0, "3.2", "4.0", "4.1", "4.2", "5.0"] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
# Base python cache on the hash of pyproject.toml with requirements | ||
# if the file changes, the cache is invalidated. | ||
- name: Cache pip | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-${{ hashFiles('pyproject.toml') }} | ||
restore-keys: | | ||
pip-${{ hashFiles('pyproject.toml') }} | ||
pip- | ||
- name: Install package with dependencies | ||
run: | | ||
if [ "${{ matrix.django }}" -gt "0"]; then pip install -q Django==${{ matrix.django }} '.[django_test]'; fi | ||
pip install . | ||
pip install '.[test]' | ||
pip install codecov | ||
- name: Setup test settings | ||
run: | | ||
cp ci/testsettings.py testsettings.py | ||
python -c "import uuid; print('SECRET_KEY = \'%s\'' % uuid.uuid4())" >> testsettings.py | ||
- name: Run pytest | ||
env: | ||
SOLR_VERSION: "${{ matrix.solr }}" | ||
run: py.test --cov=viapy --cov-report=xml | ||
|
||
- name: Upload test coverage to Codecov | ||
uses: codecov/codecov-action@v3 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "viapy" | ||
description = "Python module for interacting with VIAF data & APIs" | ||
authors = [ | ||
{name = "Center for Digital Humanities at Princeton", email = "[email protected]"}, | ||
] | ||
requires-python = ">=3.9" | ||
readme = "README.rst" | ||
license = {text = "Apache-2"} | ||
classifiers = [ | ||
"Environment :: Web Environment", | ||
"Framework :: Django", | ||
"Framework :: Django :: 3.2", | ||
"Framework :: Django :: 4.0", | ||
"Framework :: Django :: 4.1", | ||
"Framework :: Django :: 4.2", | ||
"Framework :: Django :: 5.0", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Internet :: WWW/HTTP", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"requests", "rdflib", "cached_property", "attrdict3" | ||
] | ||
|
||
[project.urls] | ||
#Documentation = "https://readthedocs.org" | ||
Repository = "https://github.com/Princeton-CDH/viapy" | ||
Changelog = "https://github.com/Princeton-CDH/viapy/blob/main/CHANGELOG.rst" | ||
|
||
[tool.hatch.version] | ||
path = "viapy/__init__.py" | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest", | ||
"pytest-cov" | ||
] | ||
django = ["django>=3.2", "django-autocomplete-light"] | ||
django_test = ["pytest-django", "viapy[django]"] | ||
docs = ["sphinx"] | ||
test_all = ["viapy[test]", "viapy[django_test]"] | ||
dev = ["pre-commit", "viapy[django]", "viapy[test_all]", "viapy[docs]"] | ||
|
||
[tool.pytest.ini_options] | ||
DJANGO_SETTINGS_MODULE = "testsettings" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.