Skip to content

Commit

Permalink
ruff not black
Browse files Browse the repository at this point in the history
  • Loading branch information
zkurtz committed Nov 14, 2024
1 parent e8c2ae9 commit e962571
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 127 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ jobs:
poetry config virtualenvs.create false
poetry install --no-interaction --no-ansi
- name: Run unit tests with pytest
run: pytest

- name: Check code formatting with Black
run: black --check .

- name: Check code quality with Ruff
run: ruff check .

- name: Check type hints with pyright
run: pyright

- name: Run unit tests with pytest
run: pytest
26 changes: 13 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.3
hooks:
- id: ruff
args: [ "--fix" ]

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

- repo: local
hooks:
- id: pyright
name: pyright
name: type checking (pyright)
entry: pyright
language: system
types: [python]
- id: ruff-format
name: formatting (ruff)
entry: ruff
language: system
types: [python]
args: ['format']
- id: ruff-lint
name: linting (ruff)
entry: ruff
language: system
types: [python]
args: ['check', '--fix', '--force-exclude']
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,24 @@ We're [on pypi](https://pypi.org/project/dummio/) so you can just `pip install d

## Development

Install poetry:
1. Install poetry: `curl -sSL https://install.python-poetry.org | python3 -`
1. Install [pyenv and its virtualenv plugin](https://github.com/pyenv/pyenv-virtualenv).
1. Create a dev ops virtual environment:
```
curl -sSL https://install.python-poetry.org | python3 -
```

Install [pyenv and its virtualenv plugin](https://github.com/pyenv/pyenv-virtualenv). Then:
```
pyenv install 3.12.2
pyenv global 3.12.2
pyenv virtualenv 3.12.2 dummio
pyenv activate dummio
```

Install this package and its dependencies in your virtual env:
```
poetry install --with extras --with dev
```

Set up git hooks:
```
pre-commit install
PYTHON_VERSION=3.12.2
function makenv {
# clean up any existing env
source deactivate
pyenv uninstall --force $1
# build new venv
pyenv install $PYTHON_VERSION --skip-existing
pyenv global $PYTHON_VERSION
pyenv virtualenv $PYTHON_VERSION $1
pyenv activate $1
poetry install --with extras --with dev
pre-commit install
poetry lock --no-update
}
makenv dummio
```
84 changes: 1 addition & 83 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dummio"
version = "0.0.2"
version = "0.0.3"
description = "Easiest-possible IO for basic file types."
authors = ["Zach Kurtz <[email protected]>"]
readme = "README.md"
Expand All @@ -21,7 +21,6 @@ ruff = "^0.6.3"
pyright = "^1.1.378"
pytest = "^8.3.2"
pre-commit = "^3.8.0"
black = "^24.8.0"
build = "^1.2.1"
twine = "^5.1.1"

Expand All @@ -40,6 +39,3 @@ include = ["dummio"]

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.black]
line-length = 120

0 comments on commit e962571

Please sign in to comment.