Skip to content

Commit

Permalink
Merge pull request #50 from lsst-sqre/tickets/DM-38650
Browse files Browse the repository at this point in the history
DM-38650: Adopt safir.redis and safir.github modules
  • Loading branch information
jonathansick authored Apr 19, 2023
2 parents fff0c33 + 6a9daf0 commit 2ffb96e
Show file tree
Hide file tree
Showing 51 changed files with 1,891 additions and 1,198 deletions.
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
max-line-length = 79
# E203: whitespace before :, flake8 disagrees with PEP-8
# W503: line break after binary operator, flake8 disagrees with PEP-8
ignore = E203, W503
exclude =
docs/conf.py
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
python:
- "3.10"
- "3.11"

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-toml

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
additional_dependencies:
- toml

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 5.0.3
rev: 6.0.0
hooks:
- id: flake8
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change log
==========

0.7.0 (2023-04-19)
------------------

- Adopt ``safir.redis.pydantic`` for Redis-backed storage.
- Adopt ``safir.github`` creating the GitHub App client and modelling of GitHub resources with Pydantic.
- Fix handling of disabled pages so that they aren't executed in a GitHub check, and are dropped if they previously existed in the database.
- Update to Python 3.11

0.6.0 (2022-08-18)
------------------

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# - Runs a non-root user.
# - Sets up the entrypoint and port.

FROM python:3.10.7-slim-bullseye as base-image
FROM python:3.11.3-slim-bullseye as base-image

# Update system packages
COPY scripts/install-base-packages.sh .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ update: update-deps init

.PHONY: run
run:
tox -e run
tox run -e=run
63 changes: 54 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"setuptools_scm[toml]>=3.4"
[project]
name = "times-square"
description = "Times Square is a service for parameterized Jupyter Notebooks as dynamic webpages."
license = { file = "LICENSE" }
readme = "README.rst"
keywords = ["rubin", "lsst"]
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: POSIX",
"Typing :: Typed",
]
build-backend = 'setuptools.build_meta'
requires-python = ">=3.11"
# Use requirements/main.in for runtime dependencies instead.
dependencies = []
dynamic = ["version"]

[project.scripts]
times-square = "timessquare.cli:main"

[project.urls]
Homepage = "https://times-square.lsst.io"
Source = "https://github.com/lsst-sqre/times-square"

[build-system]
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

Expand Down Expand Up @@ -32,7 +58,7 @@ exclude_lines = [

[tool.black]
line-length = 79
target-version = ['py38']
target-version = ['py311']
exclude = '''
/(
\.eggs
Expand All @@ -49,8 +75,8 @@ exclude = '''
# Multi-line strings are implicitly treated by black as regular expressions

[tool.isort]
include_trailing_comma = true
multi_line_output = 3
profile = "black"
line_length = 79
known_first_party = ["timessquare", "tests"]
skip = ["docs/conf.py"]

Expand All @@ -60,3 +86,22 @@ python_files = [
"tests/*.py",
"tests/*/*.py"
]

[tool.mypy]
disallow_untyped_defs = true
disallow_incomplete_defs = true
ignore_missing_imports = true
local_partial_types = true
plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"]
no_implicit_reexport = true
show_error_codes = true
strict_equality = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_ignores = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
1 change: 1 addition & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ sqlalchemy[mypy]
holdup
respx
types-PyYAML
types-redis
667 changes: 595 additions & 72 deletions requirements/dev.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions requirements/main.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ starlette
uvicorn[standard]

# Other dependencies.
safir[db,arq]
# git+https://github.com/lsst-sqre/safir.git@main#egg=safir[db,arq,redis]
safir[db,arq,redis]
pydantic[email]
click
nbformat
nbconvert
jsonschema
jinja2
aioredis
gidgethub
markdown-it-py[linkify,plugins]
mdformat
Expand Down
Loading

0 comments on commit 2ffb96e

Please sign in to comment.