Skip to content

Commit ae43dfb

Browse files
authored
Merge pull request #10 from SEED-platform/task/ruff
Added ruff, updated python compatibility
2 parents 050e29d + 37a9c0a commit ae43dfb

File tree

11 files changed

+926
-723
lines changed

11 files changed

+926
-723
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,28 @@ jobs:
1616
pre-commit:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
20-
# - name: Set up Python 3.8
21-
# uses: actions/setup-python@v4
22-
# with:
23-
# python-version: 3.8
24-
# - name: Install and configure Poetry
25-
# uses: abatilo/actions-poetry@v2
26-
# with:
27-
# poetry-version: 1.3.1
28-
# - name: Install dependencies with Poetry
29-
# run: |
30-
# poetry --version
31-
# poetry install
32-
# poetry update
19+
- uses: actions/checkout@v4
3320
- name: Run pre-commit
34-
uses: pre-commit/[email protected].0
21+
uses: pre-commit/[email protected].1
3522
with:
3623
extra_args: --all-files
3724
test:
3825
strategy:
3926
fail-fast: false
4027
matrix:
4128
os: [ubuntu-latest]
42-
python-version: ["3.8", "3.11"]
29+
python-version: ["3.9", "3.12"]
4330
runs-on: ${{ matrix.os }}
4431
steps:
45-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
4633
- name: Set up Python ${{ matrix.python-version }}
47-
uses: actions/setup-python@v4
34+
uses: actions/setup-python@v5
4835
with:
4936
python-version: ${{ matrix.python-version }}
5037
- name: Install and configure Poetry
51-
uses: abatilo/actions-poetry@v2
38+
uses: abatilo/actions-poetry@v3
5239
with:
53-
poetry-version: 1.3.1
40+
poetry-version: 1.8.3
5441
- name: Install dependencies with Poetry
5542
run: |
5643
poetry --version

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ instance/
6565
# Scrapy stuff:
6666
.scrapy
6767

68-
# Sphinx documentation
69-
docs/_build/
70-
docs/_autosummary/
71-
7268
# PyBuilder
7369
target/
7470

.pre-commit-config.yaml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
exclude: |
2-
(?x)(
3-
^docs/conf.py|
4-
^docs/license.rst
5-
)
6-
71
repos:
82
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v4.4.0
3+
rev: v4.6.0
104
hooks:
115
- id: trailing-whitespace
126
- id: check-added-large-files
@@ -21,31 +15,16 @@ repos:
2115
- id: requirements-txt-fixer
2216
- id: mixed-line-ending
2317
args: ["--fix=auto"]
24-
- repo: https://github.com/pre-commit/mirrors-autopep8
25-
rev: v2.0.1
26-
hooks:
27-
- id: autopep8
28-
args:
29-
[
30-
"--in-place",
31-
"--aggressive",
32-
"--aggressive",
33-
"--recursive",
34-
"--max-line-length=100",
35-
"--ignore=E501,E402,W503,W504,E731",
36-
]
37-
- repo: https://github.com/pycqa/flake8
38-
rev: 6.0.0
39-
hooks:
40-
- id: flake8
41-
args: ["--ignore=E501,E402,W503,W504,E731,F401"]
4218
- repo: https://github.com/pre-commit/mirrors-prettier
43-
rev: v3.0.0-alpha.4
19+
rev: v4.0.0-alpha.8
4420
hooks:
4521
- id: prettier
4622
types_or: [css, yaml, markdown, html, scss, javascript]
47-
- repo: https://github.com/pre-commit/mirrors-isort
48-
rev: v5.10.1
23+
- repo: https://github.com/astral-sh/ruff-pre-commit
24+
rev: v0.6.7
4925
hooks:
50-
- id: isort
51-
args: ["-m=VERTICAL_HANGING_INDENT"] # vertical hanging
26+
# Run the linter
27+
- id: ruff
28+
args: [--fix, --exit-non-zero-on-fix, --output-format=full]
29+
# Run the formatter
30+
- id: ruff-format

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Change Log
22

3-
## Version 0.1.0 (unreleased)
3+
## Version 0.1.1
4+
5+
Updated Python compatibility for v3.9-v3.12, and reformatted with Ruff
6+
7+
## Version 0.1.0
48

59
Develop a wrapper around the simple-salesforce Python module for
610
communicating between SEED and Salesforce.

poetry.lock

Lines changed: 684 additions & 524 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "seed-salesforce"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "Package for connecting SEED data to Salesforce"
55
authors = ["Nicholas Long <[email protected]>", "Katherine Fleming <[email protected]>"]
66
license = "BSD-3-Clause"
@@ -14,27 +14,26 @@ keywords = ["SEED Platform", "Building Benchmarking", "Salesforce", "Building Pe
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
1616
"Intended Audience :: Developers",
17-
"Programming Language :: Python :: 3.8",
1817
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
2021
]
2122
packages = [
22-
{ include = "seed_salesforce"}
23+
{ include = "seed_salesforce" }
2324
]
2425

2526
[tool.poetry.dependencies]
26-
python = ">=3.8.1, <3.11"
27-
python-dateutil = "> 0"
28-
29-
simple-salesforce = "^1.11.6"
27+
python = ">=3.9, <3.13"
28+
python-dateutil = "*"
29+
simple-salesforce = "^1.12.6"
3030

3131
[tool.poetry.dev-dependencies]
32-
autopep8 = "2.0.1"
33-
flake8 = "6.0.0"
34-
mypy = "^1.0.1"
35-
pre-commit = "3.0.4"
32+
mypy = "^1.11.2"
33+
pre-commit = "^3.8.0"
3634
pytest = "^7.1.2"
3735
pytest-cov = "^4.0.0"
36+
ruff = "^0.6.7"
3837

3938
[build-system]
4039
requires = ["poetry-core>=1.0.0"]

ruff.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
fix = true
2+
line-length = 120
3+
4+
[format]
5+
# preview = true
6+
docstring-code-format = true
7+
8+
# https://docs.astral.sh/ruff/linter/#rule-selection
9+
[lint]
10+
# preview = true
11+
# Enable these rules
12+
extend-select = [
13+
"A", # flake8-builtins
14+
"ARG", # flake8-unused-arguments
15+
# "BLE", # flake8-blind-except
16+
"C4", # flake8-comprehensions
17+
"COM", # flake8-commas
18+
# "DTZ", # flake8-datetimez
19+
"E", # Error
20+
"EXE", # flake8-executable
21+
"F", # Pyflakes
22+
"I", # isort
23+
"ICN", # flake8-import-conventions
24+
"ISC", # flake8-implicit-str-concat
25+
"N", # pep8-naming
26+
"PD", # pandas-vet
27+
"PGH", # pygrep-hooks
28+
"PIE", # flake8-pie
29+
"PLC", # Pylint Convention
30+
"PLE", # Pylint Error
31+
"PLR", # Pylint Refactor
32+
"PLW", # Pylint Warning
33+
"PT", # flake8-pytest-style
34+
"Q", # flake8-quotes
35+
"RUF", # Ruff-specific rules
36+
"S", # flake8-bandit
37+
"SIM", # flake8-simplify
38+
"T10", # flake8-debugger
39+
"TID", # flake8-tidy-imports
40+
"UP", # pyupgrade
41+
]
42+
# except for these specific errors
43+
ignore = [
44+
"E402", # module-import-not-at-top-of-file
45+
"E501", # line-too-long
46+
"E731", # lambda-assignment
47+
]
48+
49+
[lint.per-file-ignores]
50+
"tests/test_*" = [
51+
"S101", # assert
52+
"S311", # suspicious-non-cryptographic-random-usage
53+
]
54+
55+
#exclude =
56+
# .tox
57+
# .eggs
58+
# build
59+
# dist
60+
61+
[lint.pylint]
62+
# Raise the allowed limits the least possible amount https://docs.astral.sh/ruff/settings/#pylint-max-branches
63+
max-statements = 58
64+
max-branches = 24

0 commit comments

Comments
 (0)