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

Resolve base issues #127

Merged
merged 15 commits into from
Mar 14, 2024
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
41 changes: 18 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,39 @@ jobs:
- name: "Checkout the repo"
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1

- name: "Identify the week number"
run: |
date +'%U' > week-number.txt
date +'week-number=%U' >> $GITHUB_ENV

- name: "Setup Python"
id: "setup-python"
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: |
.github/workflows/ci.yaml
pyproject.toml
tox.ini
week-number.txt

- name: "Detect Pythons"
uses: "kurtmckee/detect-pythons@38187a5464f266e93e5c1467699f7be2bf521d2e" # v1.1.0

- name: "Restore the cache"
id: "restore-cache"
uses: "actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319" # v4.0.1
with:
path: |
.mypy_cache/
.tox/
.venv/
key: >
lint
week=${{ env.week-number }}
python=${{ steps.setup-python.outputs.python-version }}
hash=${{ hashFiles('.github/workflows/ci.yaml', 'pyproject.toml', 'tox.ini') }}
key: "lint-hash=${{ hashFiles('.github/workflows/ci.yaml', '.python-identifiers', 'pyproject.toml', 'tox.ini', 'requirements/*/*.txt') }}"

- name: "Install Tox"
- name: "Create virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
run: |
python -m venv .venv
.venv/bin/pip install --upgrade pip setuptools wheel
.venv/bin/pip install tox

- name: "Run mypy"
run: ".venv/bin/tox -e mypy"
- name: "Lint type annotations"
run: |
.venv/bin/tox -e mypy

- name: "Lint documentation"
run: |
.venv/bin/tox -e docs

build:
name: "Build a shared wheel"
Expand All @@ -69,7 +63,7 @@ jobs:
- name: "Identify the week number"
run: |
date +'%U' > week-number.txt
date +'week-number=%U' >> $GITHUB_ENV
date +'week-number=%U' >> "$GITHUB_ENV"

- name: "Setup Python"
id: "setup-python"
Expand All @@ -87,7 +81,7 @@ jobs:
id: "build-wheel"
run: |
pip wheel .
echo "wheel-filename=$(ls -1 globus_action_provider_tools-*.whl | head -n 1)" >> $GITHUB_OUTPUT
echo "wheel-filename=$(find globus_action_provider_tools-*.whl | head -n 1)" >> "$GITHUB_OUTPUT"

- name: "Upload the artifact"
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
Expand Down Expand Up @@ -150,7 +144,7 @@ jobs:
shell: "bash"
run: |
date +'%U' > week-number.txt
date +'week-number=%U' >> $GITHUB_ENV
date +'week-number=%U' >> "$GITHUB_ENV"

- name: "Setup Python"
id: "setup-python"
Expand Down Expand Up @@ -180,7 +174,8 @@ jobs:

- name: "Identify virtual environment path"
shell: "bash"
run: "echo 'venv-path=${{ runner.os == 'Windows' && '.venv/Scripts' || '.venv/bin' }}' >> $GITHUB_ENV"
run: |
echo 'venv-path=${{ runner.os == 'Windows' && '.venv/Scripts' || '.venv/bin' }}' >> "$GITHUB_ENV"

- name: "Install tox"
if: "steps.restore-cache.outputs.cache-hit == false"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ venv.bak/
.idea/

# Poetry
poetry.lock
/poetry.lock
26 changes: 22 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
ci:
autoupdate_schedule: "monthly"
autoupdate_schedule: "quarterly"

default_language_version:
python: "python3.12"

repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -18,13 +26,13 @@ repos:

# Enforce Python 3.8+ idioms.
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.1
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black

Expand All @@ -34,6 +42,16 @@ repos:
- id: isort

- repo: https://github.com/sirosen/slyp
rev: 0.3.0
rev: 0.6.0
hooks:
- id: slyp

- repo: https://github.com/rhysd/actionlint
rev: v1.6.27
hooks:
- id: actionlint

- repo: https://github.com/kurtmckee/pre-commit-hooks
rev: v0.1.0
hooks:
- id: verify-consistent-pyproject-toml-python-requirements
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.11"
python: "3.12"

sphinx:
configuration: "docs/source/conf.py"
fail_on_warning: true

python:
install:
- requirements: "docs/requirements.txt"
- requirements: "requirements/docs/requirements.txt"
36 changes: 11 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VIRTUAL_ENV ?= .venv

.PHONY: help install docs redoc clean test poetry.lock requirements.txt
.PHONY: help install docs redoc clean test

define HELPTEXT
Please use "make <target>" where <target> is one of:
Expand All @@ -21,18 +21,9 @@ Please use "make <target>" where <target> is one of:
test:
Run the full suite of tests

test-toolkit:
Run the toolkit's source code tests

test-examples:
Run the example Action Providers' tests

poetry.lock:
Generate this project's poetry.lock file

requirements.txt:
Generate this project's requirements.txt file

endef
export HELPTEXT

Expand All @@ -43,29 +34,24 @@ install:
poetry install

docs:
poetry run make --directory=docs html
tox run -e docs

redoc:
npx redoc-cli bundle --output index.html actions_spec.openapi.yaml
npx @redocly/cli build-docs --output index.html actions_spec.openapi.yaml

clean:
rm -rf $(VIRTUAL_ENV)
rm -rf .make_install_flag
find . -name "*.pyc" -delete
rm -rf *.egg-info
rm -f *.tar.gz
rm -rf tar-source
rm -rf dist
rm -rf .coverage
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf docs/build/*
rm -rf *.egg-info/
rm -rf dist/
rm -f .coverage
rm -rf .mypy_cache/
rm -rf .pytest_cache/
rm -rf .slyp_cache/
rm -rf docs/build/

test:
poetry run tox
tox run-parallel

poetry.lock:
poetry lock

requirements.txt:
poetry export --format requirements.txt -o requirements.txt
20 changes: 0 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
Action Provider Tools Introduction
==================================

.. image:: https://github.com/globus/action-provider-tools/workflows/Action%20Provider%20Tools%20CI/badge.svg
:target: https://github.com/globus/action-provider-tools/workflows/Action%20Provider%20Tools%20CI/badge.svg
:alt: CI Status

.. image:: https://readthedocs.org/projects/action-provider-tools/badge/?version=latest
:target: https://action-provider-tools.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://badge.fury.io/py/globus-action-provider-tools.svg
:target: https://badge.fury.io/py/globus-action-provider-tools
:alt: PyPi Package

.. image:: https://img.shields.io/pypi/pyversions/globus-action-provider-tools
:target: https://pypi.org/project/globus-action-provider-tools/
:alt: Compatible Python Versions

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/globus/action-provider-tools/workflows/Action%20Provider%20Tools%20CI/badge.svg
:alt: Code Style

This is an experimental toolkit to help developers build Action Providers for
use in Globus Automate including for invocation via Globus Flows.

Expand Down
2 changes: 1 addition & 1 deletion actions_spec.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ info:
description: |
This is the Globus Actions API description. Implementation of this API
renders a service compatible for use in the Globus Automate service.
version: 2020-02-05.1
version: 2024-03-14.1
contact:
name: Globus Support
url: "https://support.globus.org/hc/en-us/requests/new"
Expand Down
17 changes: 17 additions & 0 deletions changelog.d/20240314_103819_kurtmckee_resolve_base_issues.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Documentation
-------------

* Fix failing documentation builds (locally, and in Read the Docs).
* Enforce reproducible documentation builds using full dependency locking.
* Bump the OpenAPI documentation version and build the documentation.

Development
-----------

* Test documentation builds in GitHub CI.

Dependencies
------------

* Manage test, mypy, and doc dependencies using a consistent framework.
* Introduce a standard ``tox -m update`` that can update dependencies.
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

2 changes: 0 additions & 2 deletions docs/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"repo_type": "github",
"master_doc": True,
}
pygments_style = "stata"
pygments_style = "stata-light"

html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
Expand Down
1,067 changes: 480 additions & 587 deletions index.html

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,9 @@ pydantic = "^1.7.3"
isodate = "^0.6.0"
cachetools = "^5.0"
flask = {version = "^2.3.0", optional = true}
pytest = {version = "^7", optional = true}
freezegun = {version = "^1.2.2", optional = true}
coverage = {extras = ["toml"], version = "^7", optional = true}
responses = {version = "^0.23.3", optional = true}

[tool.poetry.extras]
flask = ["flask"]
testing = [
"coverage",
"freezegun",
"pytest",
"responses",
]

[tool.poetry.group.dev.dependencies]
docutils = "^0.16"
pygments = "^2.6.1"
sphinx = "^5.0.2"
sphinx_material = "^0.0.35"

[tool.isort]
multi_line_output = 3
Expand Down
Loading