Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 #232

Open
wants to merge 15 commits into
base: release
Choose a base branch
from
Open
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
95 changes: 95 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
version: "2.1"

orbs:
python: circleci/python@2.1.1
browser-tools: circleci/browser-tools@1.3.0

executors:
python3-9: { docker: [{ image: "cimg/python:3.9" }] }
python3-10: { docker: [{ image: "cimg/python:3.10" }] }
python3-11: { docker: [{ image: "cimg/python:3.11" }] }
python3-12: { docker: [{ image: "cimg/python:3.12" }] }

jobs:
setup:
executor: python3-12
steps:
- checkout
- python/install-packages:
pkg-manager: poetry
- run:
name: Install python dependencies
command: poetry install
build:
executor: python3-12
parameters:
python-version:
type: string
default: "py39"
steps:
- checkout
- python/install-packages:
pkg-manager: poetry
- run:
name: Install apt dependencies
command: |
sudo apt-get update
sudo apt-get install -y libfuse-dev
- run:
command: poetry build
tests: &test-template
executor: python3-12
steps:
- checkout
- python/install-packages:
pkg-manager: poetry
- run:
name: Install apt dependencies
command: |
sudo apt-get update
sudo apt-get install -y libfuse-dev
- run:
command: poetry run pytest --cov=sizefs
- run:
command: poetry run tox -e << parameters.python-version >>
tests-3-9:
<<: *test-template
executor: python3-9
parameters: { python-version: { default: "py39", type: string } }
tests-3-10:
<<: *test-template
executor: python3-10
parameters: { python-version: { default: "py310", type: string } }
tests-3-11:
<<: *test-template
executor: python3-11
parameters: { python-version: { default: "py311", type: string } }
tests-3-12:
<<: *test-template
executor: python3-12
parameters: { python-version: { default: "py312", type: string } }
linting:
executor: python3-12
steps:
- checkout
- python/install-packages:
pkg-manager: poetry
- run:
command: |
poetry run black --check .
poetry run isort --check .
name: Run linting
workflows:
main:
jobs:
- setup
- tests-3-9: { requires: [setup], python-version: "py39" }
- tests-3-10: { requires: [setup], python-version: "py310" }
- tests-3-11: { requires: [setup], python-version: "py311" }
- tests-3-12: { requires: [setup], python-version: "py312" }
- linting: { requires: [setup] }
- build:
{
requires:
[tests-3-9, tests-3-10, tests-3-11, tests-3-12, linting],
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ pip-log.txt

MANIFEST
htmlcov/

venv/
52 changes: 52 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
fail_fast: true

default_language_version:
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-ast
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-xml
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
args: ["--config", "pyproject.toml"]
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args: ["--max-line-length=120"]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/python-poetry/poetry
rev: '1.4'
hooks:
- id: poetry-check
- id: poetry-lock
args: ["--no-update", "--check"]
- repo: https://github.com/zahorniak/pre-commit-circleci.git
rev: v0.6
hooks:
- id: circleci_validate
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ v0.2, 21/09/2013 -- Initial public labs release.
v0.2.1, 20/10/2013 -- Bug fix release
v0.2.2, 20/10/2013 -- Fix Debian/python2.6 issues
v0.2.5, 08/02/2014 -- Fix pypi package
v0.3.0, 24/03/2014 -- Fixes to allow usage without FUSE, more test coverage
v0.3.0, 24/03/2014 -- Fixes to allow usage without FUSE, more test coverage
v0.4.0, 24/03/2014 -- Upgrade to python 3.9+
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/

lint: ## check style with flake8
flake8 sizefs tests sizefs/contents.pyx
poetry run black --check .
poetry run isort --check .

lint_fix: ## check style with flake8
poetry run black .
poetry run isort .

test: ## run tests quickly with the default Python
py.test
Expand Down
Loading