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

Update poetry dependencies and move audits to 3.9 #17

Open
wants to merge 5 commits into
base: main
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
4 changes: 2 additions & 2 deletions .github/workflows/ensure_green.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y make
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ understand what that's doing, though, read on.
### Running Audits

We run checks against every commit to ensure all files follow standards we enforce. The
audits we run are as follows:
audits we run are as follows (they require python 3.9 to run):

```shell
# Ensure all Markdown files would not be reformatted by us :)
Expand Down
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,26 @@ audits:
done; \
exit $$status

black: _venv_3.8
black: _venv_3.9
poetry env use 3.9
git ls-files | egrep '.*\.pyi?$$' | xargs poetry run black --check

flake8: _venv_3.8
flake8: _venv_3.9
poetry env use 3.9
git ls-files | egrep '.*\.py$$' | egrep -v 'docs/' | \
xargs poetry run flake8 --max-line-length 88

markflow: _venv_3.8
markflow: _venv_3.9
poetry env use 3.9
git ls-files | egrep ".md$$" | grep -v "/files/" | xargs poetry run markflow --check

# --- TESTS ---
.PHONY: tests tests_3.6 tests_3.7 tests_3.8 tests_3.9
tests: utests mypy ensure_deps
tests_3.6: utests_3.6 ensure_deps_3.6
tests_3.7: utests_3.7 ensure_deps_3.7
tests_3.8: utests_3.8 mypy ensure_deps_3.8
tests_3.9: utests_3.9 ensure_deps_3.9
tests_3.8: utests_3.8 ensure_deps_3.8
tests_3.9: utests_3.9 ensure_deps_3.9 mypy

# Ensure dependencies are properly specified
.PHONY: ensure_deps _ensure_deps ensure_deps_3.6 ensure_deps_3.7 ensure_deps_3.8 ensure_deps_3.9
Expand Down Expand Up @@ -90,16 +93,16 @@ ensure_deps_3.9:
.PHONY: mypy mypy_lib mypy_tests
mypy: mypy_lib mypy_tests

mypy_lib: _venv_3.8
mypy_lib: _venv_3.9
# --implicity-reexport means that we don't have to explicitly tell mypy about our
# modules' members via a `__all__`
poetry env use 3.8
MYPYPATH=$(CURDIR)/stubs poetry run mypy --strict --implicit-reexport markflow
poetry env use 3.9
MYPYPATH=$(CURDIR)/stubs poetry run mypy -vv --strict --implicit-reexport markflow

mypy_tests: _venv_3.8
mypy_tests: _venv_3.9
# --implicity-reexport means that we don't have to explicitly tell mypy about our
# modules' members via a `__all__`
poetry env use 3.8
poetry env use 3.9
MYPYPATH=$(CURDIR)/stubs poetry run mypy --strict --implicit-reexport tests

# Unit Tests
Expand Down
2 changes: 1 addition & 1 deletion markflow/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _reformat_stdin(args: argparse.Namespace, stdin: TextIO) -> int:

if args.check:
if new_contents != old_contents:
print_markdown(f"STDIN would be reformatted.")
print_markdown("STDIN would be reformatted.")
return 1
else:
print_markdown("STDIN would be unchanged.")
Expand Down
2 changes: 1 addition & 1 deletion markflow/reformat_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ def reformat_markdown_text(text: str, width: Number = 88) -> str:
new_text = _reformat_markdown_text(text, width)
if new_text != _reformat_markdown_text(new_text, width):
raise ReformatInconsistentException(
f"Reformat of reformatted code results in different text."
"Reformat of reformatted code results in different text."
)
return new_text
Loading