Skip to content

Commit

Permalink
Merge pull request #27 from alan-turing-institute/update-dependencies
Browse files Browse the repository at this point in the history
Update Python dependencies
  • Loading branch information
jemrobinson authored Jan 9, 2025
2 parents 65825a9 + 8277a6d commit d74dfc6
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 61 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/lint_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Lint code

# Run workflow on PRs and pushes to matching branches
on: # yamllint disable-line rule:truthy
push:
branches: [main]
pull_request:

jobs:
lint_code:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install hatch
run: pip install hatch

- name: Test Python
run: hatch run lint:all
2 changes: 2 additions & 0 deletions guacamole_user_sync/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Synchronise a Guacamole PostgreSQL database with an LDAP server."""

from .__about__ import __version__ as version

__all__ = ["version"]
2 changes: 2 additions & 0 deletions guacamole_user_sync/ldap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Interact with the LDAP server."""

from .ldap_client import LDAPClient

__all__ = [
Expand Down
2 changes: 2 additions & 0 deletions guacamole_user_sync/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Models used for LDAP and PostgreSQL interactions."""

from .exceptions import LDAPError, PostgreSQLError
from .guacamole import GuacamoleUserDetails
from .ldap_objects import LDAPGroup, LDAPUser
Expand Down
4 changes: 3 additions & 1 deletion guacamole_user_sync/postgresql/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"""Interact with the PostgreSQL server."""

from .postgresql_backend import PostgreSQLBackend, PostgreSQLConnectionDetails
from .postgresql_client import PostgreSQLClient
from .sql import SchemaVersion

__all__ = [
"PostgreSQLBackend",
"PostgreSQLConnectionDetails",
"PostgreSQLClient",
"PostgreSQLConnectionDetails",
"SchemaVersion",
]
69 changes: 9 additions & 60 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ classifiers = [
]
dependencies = [
"ldap3==2.9.1",
"psycopg==3.2.1",
"SQLAlchemy==2.0.32",
"sqlparse==0.5.1",
"psycopg==3.2.3",
"SQLAlchemy==2.0.36",
"sqlparse==0.5.3",
]

[project.urls]
Expand All @@ -34,13 +34,13 @@ Source = "https://github.com/alan-turing-institute/guacamole-user-sync"

[project.optional-dependencies]
lint = [
"black==24.8.0",
"mypy==1.11.2",
"ruff==0.6.2",
"black==24.10.0",
"mypy==1.14.1",
"ruff==0.9.0",
]
test = [
"coverage[toml]==7.6.1",
"pytest==8.3.2",
"coverage[toml]==7.6.10",
"pytest==8.3.4",
]

[tool.coverage.paths]
Expand Down Expand Up @@ -100,64 +100,13 @@ module = [
ignore_missing_imports = true

[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # McCabe complexity
"COM", # flake8-commas
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"EM", # flake8-errmsg
"F", # pyflakes
"FA", # flake8-future-annotations
"FBT", # flake8-boolean-trap
"FLY", # flynt
"FURB", # refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"PERF", # perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-rse
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
select = ["ALL"]
ignore = [
"ANN101", # missing-type-self [deprecated]
"ANN102", # missing-type-cls [deprecated]
"D100", # undocumented-public-module
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D105", # undocumented-magic-method
"D107", # undocumented-public-init
"D203", # one-blank-line-before-class [conflicts with D211]
"D213", # multi-line-summary-second-line [conflicts with D212]
"D400", # ends-in-period [conflicts with D415]
"S101", # assert [conflicts with pytest]
]
Empty file modified synchronise.py
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for the guacamole_user_sync package."""

0 comments on commit d74dfc6

Please sign in to comment.