Skip to content

Commit

Permalink
Merge pull request #423 from catalyst-cooperative/docker-actions
Browse files Browse the repository at this point in the history
Update docker github action versions
  • Loading branch information
zaneselvans authored Feb 27, 2025
2 parents aa81e73 + 647c9d1 commit b82d811
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- name: Docker Metadata
id: docker_metadata
uses: docker/metadata-action@v5.6.1
uses: docker/metadata-action@v5.7.0
with:
images: catalystcoop/cheshire-docker-build-push
flavor: |
Expand All @@ -21,7 +21,7 @@ jobs:
type=ref,event=tag
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.9.0
uses: docker/setup-buildx-action@v3.10.0

- name: Login to DockerHub
if: github.event_name != 'pull_request'
Expand All @@ -31,7 +31,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build image and push to Docker Hub
uses: docker/build-push-action@v6.14.0
uses: docker/build-push-action@v6.15.0
with:
context: .
file: docker/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tox-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
fail-fast: false
defaults:
run:
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: mambaforge-4.10
python: mambaforge-23.11

# Define the python environment using conda / mamba
conda:
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.

import datetime
import importlib.metadata
import shutil
from pathlib import Path

import pkg_resources
from sphinx.application import Sphinx

DOCS_DIR = Path(__file__).parent.resolve()

# -- Path setup --------------------------------------------------------------
# We are building and installing the pudl package in order to get access to
# the distribution metadata, including an automatically generated version
# number via pkg_resources.get_distribution() so we need more than just an
# number via importlib.metadata.version() so we need more than just an
# importable path.

# The full version, including alpha/beta/rc tags
release = pkg_resources.get_distribution("catalystcoop.cheshire").version
release = importlib.metadata.version("catalystcoop.cheshire")

# -- Project information -----------------------------------------------------

Expand Down
10 changes: 5 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ channels:
- conda-forge
dependencies:
# Packages required for setting up the environment
- pip>=21,<25
- python>=3.10,<3.13
- setuptools>=66
- pip>=21,<26
- python>=3.10,<3.14
- setuptools>=75

# Packages specified in setup.py that need or benefit from binary conda packages
# - geopandas>=0.9,<0.11
Expand All @@ -18,8 +18,8 @@ dependencies:
# - numba>=0.55.1,<0.57 # numba speeds up some kinds of math by 100x

# Jupyter packages:
- jupyterlab>=3.2,<4
- nbconvert>=6,<7 # Used to clear notebook outputs in pre-commit hooks
- jupyterlab>=4,<5
- nbconvert>=7,<8 # Used to clear notebook outputs in pre-commit hooks

# These are not normal Python packages available on PyPI
- nodejs # Useful for Jupyter and prettier pre-commit hook
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=66",
"setuptools>=75",
"setuptools_scm[toml]>=3.5.0",
"wheel",
]
Expand All @@ -14,7 +14,7 @@ readme = {file = "README.rst", content-type = "text/x-rst"}
authors = [
{name = "Catalyst Cooperative", email = "[email protected]"}
]
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
dynamic = ["version"]
license = {file = "LICENSE.txt"}
dependencies = [
Expand All @@ -34,6 +34,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
keywords = [
"template",
Expand Down Expand Up @@ -62,10 +63,10 @@ dev = [
]
docs = [
"doc8>=1,<2", # Ensures clean documentation formatting
"furo>=2022.4.7",
"sphinx>=6,<9", # The default Python documentation engine
"sphinx-autoapi>=2,<4", # Generates documentation from docstrings
"sphinx-issues>=1.2,<6", # Allows references to GitHub issues
"furo>=2024,<2026",
"sphinx>=8,<9", # The default Python documentation engine
"sphinx-autoapi>=3,<4", # Generates documentation from docstrings
"sphinx-issues>=5,<6", # Allows references to GitHub issues

]
tests = [
Expand All @@ -80,7 +81,7 @@ tests = [
"pytest-console-scripts>=1.1,<2", # Allow automatic testing of scripts
"pytest-cov>=4,<7", # Pytest plugin for working with coverage
"pytest>=7,<9", # Our testing framework
"ruff>=0.6", # A very fast python linter & autofixer
"ruff>=0.9", # A very fast python linter & autofixer
"tox>=4,<5", # Python test environment manager
]
types = [
Expand Down
5 changes: 2 additions & 3 deletions src/cheshire/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""A template repository for a Python package created by Catalyst Cooperative."""

import importlib.metadata
import logging

import pkg_resources

# In order for the package modules to be available when you import the package,
# they need to be imported here somehow. Not sure if this is best practice though.
import cheshire.cli
Expand All @@ -14,7 +13,7 @@
__maintainer__ = "Cheshire Cat"
__license__ = "MIT License"
__maintainer_email__ = "[email protected]"
__version__ = pkg_resources.get_distribution("catalystcoop.cheshire").version
__version__ = importlib.metadata.version("catalystcoop.cheshire")
__docformat__ = "restructuredtext en"
__description__ = "A template for Python package repositories."
__long_description__ = """
Expand Down
15 changes: 6 additions & 9 deletions tests/integration/console_scripts_test.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
"""Test the PUDL console scripts from within PyTest."""

import pkg_resources
import importlib.metadata

import pytest

# Obtain a list of all deployed entry point scripts to test:
ENTRY_POINTS = [
ep.name
for ep in pkg_resources.iter_entry_points("console_scripts")
if ep.module_name.startswith("cheshire")
]
ENTRY_POINTS = importlib.metadata.distribution("catalystcoop.cheshire").entry_points


@pytest.mark.parametrize("ep", ENTRY_POINTS)
@pytest.mark.script_launch_mode("inprocess")
def test_pudl_scripts(script_runner, ep: str) -> None:
def test_pudl_scripts(script_runner, ep: importlib.metadata.EntryPoint) -> None:
"""Run each deployed console script with --help as a basic test.
The script_runner fixture is provided by the pytest-console-scripts plugin.
"""
ret = script_runner.run(ep, "--help", print_result=False)
ret = script_runner.run([ep.name, "--help"], print_result=False)
assert ret.success # nosec: B101


Expand All @@ -34,5 +31,5 @@ def test_pudl_scripts(script_runner, ep: str) -> None:
@pytest.mark.script_launch_mode("inprocess")
def test_winston_args(script_runner, alpha: str, beta: str) -> None:
"""Try running the script with bad inputs."""
ret = script_runner.run("winston", "--alpha", alpha, "--beta", beta)
ret = script_runner.run(["winston", "--alpha", alpha, "--beta", beta])
assert ret.success # nosec: B101

0 comments on commit b82d811

Please sign in to comment.