Skip to content

Commit

Permalink
Merge branch 'main' into configure-group-search
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio authored Sep 15, 2024
2 parents 1c42a39 + 2151b13 commit 8aa1f8f
Show file tree
Hide file tree
Showing 21 changed files with 619 additions and 483 deletions.
16 changes: 0 additions & 16 deletions .coveragerc

This file was deleted.

19 changes: 2 additions & 17 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,5 @@
# E: style errors
# W: style warnings
# C: complexity
# F401: module imported but unused
# F403: import *
# F811: redefinition of unused `name` from line `N`
# F841: local variable assigned but never used
# E402: module level import not at top of file
# I100: Import statements are in the wrong order
# I101: Imported names are in the wrong order. Should be
ignore = E, C, W, F401, F403, F811, F841, E402, I100, I101, D400
builtins = c, get_config
exclude =
.cache,
.github,
onbuild,
scripts,
share,
tools,
setup.py
# D: docstring warnings (unused pydocstyle extension)
ignore = E, C, W, D
16 changes: 16 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dependabot.yaml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
#
# Notes:
# - Status and logs from dependabot are provided at
# https://github.com/jupyterhub/systemdspawner/network/updates.
#
version: 2
updates:
# Maintain dependencies in our GitHub Workflows
- package-ecosystem: github-actions
directory: /
labels: [ci]
schedule:
interval: monthly
time: "05:00"
timezone: Etc/UTC
50 changes: 50 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
name: Release

# Always tests wheel building, but only publish to PyPI on pushed tags.
on:
pull_request:
paths-ignore:
- "**.md"
- ".github/workflows/*.yaml"
- "!.github/workflows/release.yaml"
push:
paths-ignore:
- "**.md"
- ".github/workflows/*.yaml"
- "!.github/workflows/release.yaml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags: ["**"]
workflow_dispatch:

jobs:
build-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: install build package
run: |
pip install --upgrade pip
pip install build
pip freeze
- name: build release
run: |
python -m build --sdist --wheel .
ls -l dist
- name: publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
with:
user: __token__
password: ${{ secrets.pypi_password }}
64 changes: 64 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
name: Tests

on:
pull_request:
paths-ignore:
- "**.md"
- ".github/workflows/*.yaml"
- "!.github/workflows/test.yaml"
push:
paths-ignore:
- "**.md"
- ".github/workflows/*.yaml"
- "!.github/workflows/test.yaml"
branches-ignore:
- "dependabot/**"
- "pre-commit-ci-update-config"
tags: ["**"]
workflow_dispatch:

env:
LDAP_HOST: 127.0.0.1

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
include:
- python-version: "3.9"
pip-install-spec: "jupyterhub==4.*"
- python-version: "3.12"
pip-install-spec: "jupyterhub==5.*"
- python-version: "3.x"
pip-install-spec: "--pre jupyterhub"

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"

- name: Install Python dependencies
run: |
pip install ${{ matrix.pip-install-spec }}
pip install -e ".[test]"
- name: List packages
run: pip freeze

- name: Run tests
run: |
# start LDAP server
ci/docker-ldap.sh
pytest --cov=ldapauthenticator
# GitHub action reference: https://github.com/codecov/codecov-action
- uses: codecov/codecov-action@v4
81 changes: 63 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,64 @@
# pre-commit is a tool to perform a predefined set of tasks manually and/or
# automatically before git commits are made.
#
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
#
# Common tasks
#
# - Run on all files: pre-commit run --all-files
# - Register git hooks: pre-commit install --install-hooks
#
repos:
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.9.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/ambv/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: end-of-file-fixer
- id: check-json
- id: check-yaml
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: requirements-txt-fixer
- id: flake8
# Autoformat: Python code, syntax patterns are modernized
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args:
- --py39-plus

# Autoformat: Python code
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
args:
- --in-place

# Autoformat: Python code
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black

# Autoformat: markdown, yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier

# Misc...
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available
hooks:
- id: end-of-file-fixer
- id: check-case-conflict
- id: check-executables-have-shebangs

# Lint: Python code
- repo: https://github.com/pycqa/flake8
rev: "7.1.1"
hooks:
- id: flake8

# pre-commit.ci config reference: https://pre-commit.ci/#configuration
ci:
autoupdate_schedule: monthly
73 changes: 0 additions & 73 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 8aa1f8f

Please sign in to comment.