Skip to content
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
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.13"
python-version-file: ".python-version"

- name: Install Poetry
run: |
pip install poetry
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Build the distribution
run: |
poetry build
uv build

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,29 @@ on:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version-file: ".python-version"

- name: Run pre-commit
uses: pre-commit/action@v3.0.1

code-checks:
name: Test - Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ dmypy.json
cython_debug/
{"mode":"full","isActive":false}

.python-version
.vim
.nvimrc
Session.vim
28 changes: 8 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.11.5
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
- repo: local
hooks:
- id: pyright
name: pyright
entry: poetry run npx pyright@1.1.402
language: node
pass_filenames: false
types: [python]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.7"
hooks:
# Run the linter.
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter.
- id: ruff-format
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
8 changes: 6 additions & 2 deletions dslr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

import click
import timeago
import tomli

if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib
from rich import box
from rich.table import Table

Expand Down Expand Up @@ -57,7 +61,7 @@ def cli(url, debug):
toml_params = {}
try:
with open("dslr.toml", "rb") as tomlf:
toml_params = tomli.load(tomlf)
toml_params = tomllib.load(tomlf)
except FileNotFoundError:
pass

Expand Down
1,544 changes: 0 additions & 1,544 deletions poetry.lock

This file was deleted.

81 changes: 47 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,66 @@
[tool.poetry]
[project]
name = "DSLR"
version = "0.6.0"
description = "Take lightning fast snapshots of your local Postgres databases."
authors = ["Mitchel Cabuloy <mixxorz@gmail.com>"]
license = "MIT"
keywords = ["database", "snapshot", "backup"]
readme = "README.md"
homepage = "https://github.com/mixxorz/DSLR"
repository = "https://github.com/mixxorz/DSLR"
license = {text = "MIT"}
requires-python = ">=3.10,<4.0"
authors = [
{name = "Mitchel Cabuloy", email = "mixxorz@gmail.com"},
]
keywords = [
"database",
"snapshot",
"backup",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Topic :: Database",
]
include = [
"LICENSE",
dependencies = [
"click>=8.1.3,<9",
"rich>=13.8.1,<14",
"timeago>=1.0.15,<2",
"tomli>=2.0.1,<3; python_version < '3.11'",
]

[tool.poetry.dependencies]
python = "^3.9"
click = "^8.1.3"
rich = "^13.8.1"
timeago = "^1.0.15"
tomli = "^2.0.1"
psycopg2 = { version = "^2.9.3", optional = true }
psycopg2-binary = { version = "^2.9.3", optional = true }
psycopg = { version = "^3.1.14", optional = true }

[tool.poetry.extras]
psycopg2 = ["psycopg2"]
psycopg2-binary = ["psycopg2-binary"]
psycopg = ["psycopg"]
[project.optional-dependencies]
psycopg2 = ["psycopg2>=2.9.3,<3"]
psycopg2-binary = ["psycopg2-binary>=2.9.3,<3"]
psycopg = ["psycopg>=3.1.14,<4"]

[tool.poetry.group.dev.dependencies]
isort = "^5.11.5"
flake8 = "^7.3.0"
black = "^22.6.0"
ipdb = "^0.13.9"
tox = "^4"
twine = "^4.0.1"
[project.urls]
homepage = "https://github.com/mixxorz/DSLR"
repository = "https://github.com/mixxorz/DSLR"

[tool.poetry.scripts]
[project.scripts]
dslr = "dslr.cli:cli"

[tool.pyright]
reportMissingImports = false
[dependency-groups]
dev = [
"ruff>=0.8.0",
"ipdb>=0.13.9,<1",
"pre-commit>=4.5.1",
"tox>=4,<5",
"twine>=4.0.1,<5",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
default-groups = []

[tool.ruff.lint]
select = [
"C", # flake8-comprehensions
"B", # flake8-bugbear
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"W", # pycodestyle warnings
]
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

25 changes: 1 addition & 24 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[tox]
isolated_build = True
envlist =
flake8
black
isort
pyright
py39-psycopg2
py39-psycopg3
py310-psycopg2
py310-psycopg3
py311-psycopg2
Expand All @@ -18,11 +12,10 @@ envlist =

[gh-actions]
python =
3.9: py39-psycopg2, py39-psycopg3
3.10: py310-psycopg2, py310-psycopg3
3.11: py311-psycopg2, py311-psycopg3
3.12: py312-psycopg2, py312-psycopg3
3.13: py313-psycopg2, py313-psycopg3, flake8, black, isort, pyright
3.13: py313-psycopg2, py313-psycopg3

[testenv]
commands =
Expand All @@ -33,19 +26,3 @@ deps = psycopg2-binary

[testenv:{py39,py310,py311,py312,py313}-psycopg3]
deps = psycopg

[testenv:flake8]
deps = flake8 >=7.3.0, <8.0.0
commands = flake8

[testenv:black]
deps = black >=22.6.0, <23.0.0
commands = black --check ./

[testenv:pyright]
deps = pyright == 1.1.402
commands = pyright

[testenv:isort]
deps = isort >= 5.10.1, <6.0.0
commands = isort dslr tests --check-only --diff
Loading
Loading