Skip to content

Commit

Permalink
Added ruff, updated dependencies and python compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed Sep 24, 2024
1 parent 050e29d commit 72a30cf
Show file tree
Hide file tree
Showing 9 changed files with 919 additions and 690 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# - name: Set up Python 3.8
# uses: actions/setup-python@v4
# with:
Expand All @@ -31,26 +31,26 @@ jobs:
# poetry install
# poetry update
- name: Run pre-commit
uses: pre-commit/[email protected].0
uses: pre-commit/[email protected].1
with:
extra_args: --all-files
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.11"]
python-version: ["3.9", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure Poetry
uses: abatilo/actions-poetry@v2
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.3.1
poetry-version: 1.8.3
- name: Install dependencies with Poetry
run: |
poetry --version
Expand Down
33 changes: 9 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exclude: |
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -21,31 +21,16 @@ repos:
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ["--fix=auto"]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.1
hooks:
- id: autopep8
args:
[
"--in-place",
"--aggressive",
"--aggressive",
"--recursive",
"--max-line-length=100",
"--ignore=E501,E402,W503,W504,E731",
]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--ignore=E501,E402,W503,W504,E731,F401"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [css, yaml, markdown, html, scss, javascript]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.7
hooks:
- id: isort
args: ["-m=VERTICAL_HANGING_INDENT"] # vertical hanging
# Run the linter
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --output-format=full]
# Run the formatter
- id: ruff-format
1,208 changes: 684 additions & 524 deletions poetry.lock

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "seed-salesforce"
version = "0.1.0"
version = "0.1.1"
description = "Package for connecting SEED data to Salesforce"
authors = ["Nicholas Long <[email protected]>", "Katherine Fleming <[email protected]>"]
license = "BSD-3-Clause"
Expand All @@ -17,24 +17,25 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
packages = [
{ include = "seed_salesforce"}
]

[tool.poetry.dependencies]
python = ">=3.8.1, <3.11"
python = ">=3.9, <3.13"
python-dateutil = "> 0"

simple-salesforce = "^1.11.6"
simple-salesforce = "^1.12.6"

[tool.poetry.dev-dependencies]
autopep8 = "2.0.1"
flake8 = "6.0.0"
mypy = "^1.0.1"
pre-commit = "3.0.4"
mypy = "^1.11.2"
pre-commit = "3.8.0"
pytest = "^7.1.2"
pytest-cov = "^4.0.0"
ruff = "^0.6.7"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
65 changes: 65 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
fix = true
line-length = 120

[format]
# preview = true
docstring-code-format = true

# https://docs.astral.sh/ruff/linter/#rule-selection
[lint]
# preview = true
# Enable these rules
extend-select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
# "BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"COM", # flake8-commas
# "DTZ", # flake8-datetimez
"E", # Error
"EXE", # flake8-executable
"F", # Pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PLC", # Pylint Convention
"PLE", # Pylint Error
"PLR", # Pylint Refactor
"PLW", # Pylint Warning
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"T10", # flake8-debugger
"TID", # flake8-tidy-imports
"UP", # pyupgrade
]
# except for these specific errors
ignore = [
"E402", # module-import-not-at-top-of-file
"E501", # line-too-long
"E731", # lambda-assignment
]

[lint.per-file-ignores]
"tests/test_*" = [
"S101", # assert
"S311", # suspicious-non-cryptographic-random-usage
]

#exclude =
# .tox
# .eggs
# build
# dist
# docs/conf.py

[lint.pylint]
# Raise the allowed limits the least possible amount https://docs.astral.sh/ruff/settings/#pylint-max-branches
max-statements = 58
max-branches = 24
Loading

0 comments on commit 72a30cf

Please sign in to comment.