Skip to content

Commit

Permalink
feat: update to Python 3.12, remove black for ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
qartik committed Sep 6, 2024
1 parent 4aedb5a commit 4467d1d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
12 changes: 4 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,24 @@ repos:
- id: debug-statements

- repo: https://github.com/crate-ci/typos
rev: v1.21.0
rev: v1.24.5
hooks:
- id: typos
args: []

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
rev: v0.6.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/dosisod/refurb
rev: v2.0.0
hooks:
- id: refurb

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.364
rev: v1.1.379
hooks:
- id: pyright
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim-buster
FROM python:3.12-slim

# Set the working directory to /pytemplate
WORKDIR /pytemplate
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pytemplate

This is a Python 3.11 app called pytemplate. The project includes Docker, Pyright, Ruff, GitHub Actions, Black, pre-commit, and Sphinx.
This is a Python 3.12 app called pytemplate. The project includes Docker, pyright, ruff, typos, GitHub Actions, pre-commit, and Sphinx.

<details>

Expand Down Expand Up @@ -45,7 +45,7 @@ The project uses toml for configuration instead of `setup.py`. The configuration

The project includes Docker, with a `Dockerfile` located in the root directory. The `.dockerignore` file is also located in the root directory.

The project includes Pyright for static type checking, pre-commit for code formatting, Black for code formatting and Ruff for linting. The configuration for these tools is located in the `.pre-commit-config.yaml` and `ruff.toml` files.
The project includes `pyright` for static type checking, `typos` for code spell check, `ruff` for linting & code formatting, and `pre-commit` for enforcing these checks before git commits and on the CI. The configuration for these tools is located in the `ruff.toml` and `.pre-commit-config.yaml` files.

The project includes Sphinx for documentation, with the documentation located in the `docs` folder. The `source/conf.py` file contains the configuration for Sphinx.

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pytemplate"
version = "0.0.1"
description = "A python library"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.12"
authors = [{name = "Author", email = "[email protected]" }]

[tool.setuptools.packages.find]
Expand All @@ -20,7 +20,7 @@ Repository = "https://github.com/CQCL/pytemplate.git"
[tool.pyright]
include = ["pytemplate","tests"]
ignore = ["**/*.ipynb"]
pythonVersion = "3.11"
pythonVersion = "3.12"
typeCheckingMode = "strict"

[tool.pytest.ini_options]
Expand All @@ -29,4 +29,4 @@ pythonpath = [
]

[tool.refurb]
python_version = "3.11"
python_version = "3.12"
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
black==24.8.0
build==1.2.1
pre-commit==3.8.0
pyright==1.1.364
pyright==1.1.379
pytest==8.3.2
sphinx==8.0.2
wheel==0.44.0
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://docs.astral.sh/ruff/rules/
target-version = "py311"
target-version = "py312"

line-length = 88

Expand Down

0 comments on commit 4467d1d

Please sign in to comment.