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

Refactor step 2: replace Node traversal with ast.NodeVisitor #93

Closed
wants to merge 67 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
1a671bb
exclude test_data/samples/* from black, isort, mypy
Apr 25, 2023
dbce624
remove black, isort, mypy config from tox.ini
Apr 25, 2023
056f6e2
remove black, isort, mypy config from github ci
Apr 25, 2023
ac2840c
remove testing of setup.py in tox.ini
Apr 25, 2023
5b8776c
remove setup.py
Apr 25, 2023
d50431a
move config from setup.cfg to pyproject.toml
Apr 25, 2023
0c8cf68
remove mention of setup.py in readme
Apr 25, 2023
556e674
update tox.ini for PEP517 compatibility
Apr 25, 2023
f4c9aae
Merge branch 'master' into pyproject-toml
Apr 26, 2023
8c4190a
update release ci to not use setup.py
Apr 26, 2023
aa7f40b
remove setup.py from readme
Apr 26, 2023
e1088e0
Merge branch 'master' into fix-72
Apr 26, 2023
b5456a8
introduce Config class, that parses pyproject.toml and iterates over …
Apr 26, 2023
f6439b9
remove redundant find_python_files code, add find_project_root
Apr 26, 2023
fa2b99f
use new config to iterate over python files
Apr 26, 2023
193af08
remove unnecessary error handling, both are handled by config.files()
Apr 26, 2023
5080f51
add config for ssort
Apr 26, 2023
3955ad8
update tox.ini for PEP517 compatibility
Apr 25, 2023
ce73311
Merge branch 'pyproject-toml' into fix-72
Apr 26, 2023
3d55df1
update tests for _files.py
Apr 26, 2023
3b91f35
fix bug find_project_root
Apr 26, 2023
6a659df
use tomli for python < 3.11, tomlib for python >= 3.11
Apr 26, 2023
797424b
add tomli dependency
Apr 26, 2023
cafa5bb
remove pathspec mypy block since pathspec is not longer needed
Apr 26, 2023
674ef12
remove test to check for not existent file, this cannot happen anymore
Apr 26, 2023
91d8317
mock find_project_root so that pytest does not search for pyproject.t…
Apr 26, 2023
192d9ec
ssort only sorts the inteded files, not all files under root
Apr 26, 2023
be890a4
Merge branch 'master' into fix-72
Apr 27, 2023
f18cee6
Merge branch 'master' into fix-72
Apr 30, 2023
27fee83
Revert "remove unnecessary error handling, both are handled by config…
Apr 30, 2023
7a44e8a
Revert "remove test to check for not existent file, this cannot happe…
Apr 30, 2023
64ae5b6
non existent and no py files are now handled by the config class and …
Apr 30, 2023
7d57482
FileNotFoundError case handled by config
Apr 30, 2023
7e41274
path is directory is handled by dir iterator of config
Apr 30, 2023
31381d9
add tests for config
Apr 30, 2023
de951ec
update tox.ini to use new config
Apr 30, 2023
be59549
Merge branch 'master' into fix-72
Apr 30, 2023
9415c06
define pytest test path in pyproject.toml
Apr 30, 2023
f8e49de
sync tox.ini and ci.yaml
Apr 30, 2023
d65d304
export only get_config_from_root using __all__
Apr 30, 2023
e9689b5
fix import statement to mirror the others
Apr 30, 2023
08cb4d7
add current working dir to find_project_root to find the expected pyp…
May 1, 2023
6bbf597
add skip_glob configuration key to filter files with glob pattern
May 1, 2023
ad3ff91
add tests for Config.is_invalid
May 1, 2023
8c049d1
fix a bug where glob pattern was incorrectly applied if path was not …
May 1, 2023
ee33e99
create current_working_dir to make testing easier, add more tests
May 1, 2023
77e6705
remove __pycache__ and .pytest_cache to match blacks defaults
May 1, 2023
4440ec6
ignore __pycache__ and .pytest_cache folders
May 1, 2023
7eb76c0
move sort_key_from_iter to _grahps.py
Apr 30, 2023
014f6d1
move single_dispatch to its own file
Apr 30, 2023
e6a372a
move cached_method to _statements.py
Apr 30, 2023
27ec33e
move remaining functions to _files.py
Apr 30, 2023
d4be66c
move single_dispatch to its own file
Apr 30, 2023
a55658b
move cached_method to _statements.py
Apr 30, 2023
66e64c1
move remaining functions to _files.py
Apr 30, 2023
c78111a
add new py311 exceptions
Apr 30, 2023
6a89bed
sort exceptions alphabetically
Apr 30, 2023
6d546c5
handle new ExceptionGroups i.e. ast.TryStar
Apr 30, 2023
37cde4b
add tests for python 3.11
Apr 30, 2023
0958473
add version guard for ast.TryStar
Apr 30, 2023
f8d7e36
add test for exception groups
Apr 30, 2023
3cc1ab9
rename ast iter_child function
Apr 30, 2023
8137fa6
replace get_bindings with ast.NodeVisitor implementation
Apr 30, 2023
24789d9
replace get_method_requirements with ast.NodeVisitor implementation
Apr 30, 2023
bd9bb7a
replace get_requirements with ast.NodeVisitor implementation
Apr 30, 2023
ec26adf
remove redundant modules
Apr 30, 2023
a1ababe
extract smart NodeVisitor logic to SmartNodeVisitor
May 1, 2023
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: "Unit Tests"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ["ubuntu-22.04", "windows-2019", "macos-11"]
runs-on: ${{ matrix.runs-on }}
steps:
Expand All @@ -22,12 +22,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install pytest pytest-mock
pip install pyyaml==6.0
pip install -e .[test]
- name: Run tests
run: |
pytest -vv tests/
pytest -vv

coverage:
name: "Coverage"
Expand All @@ -41,12 +41,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov coveralls
pip install pytest pytest-cov pytest-mock coveralls
pip install pyyaml==6.0
pip install -e .[test]
- name: Run tests
run: |
pytest --cov=ssort -v tests/
pytest --cov=ssort -v
- name: Upload coverage report to coveralls
run: |
coveralls --service=github
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
pip install -e .
- name: Run ssort
run: |
ssort --check --diff src/ tests/
ssort --check --diff .

pyflakes:
name: "PyFlakes"
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ exclude = "test_data/samples/*"
ignore_missing_imports = true
module = "pathspec"

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

[tool.setuptools]
include-package-data = false
license-files = [
Expand All @@ -75,3 +80,10 @@ attr = "ssort.__version__"

[tool.setuptools.packages.find]
where = ["src"]

[tool.ssort]
extend_skip = [
".pytest_cache",
"__pycache__",
"test_data"
]
Loading