Skip to content

Commit

Permalink
Fix lints + add git to release CI
Browse files Browse the repository at this point in the history
- Remove black + mypy as linting already runs it ...
- Ignore delete param to TemporaryDirectory as we can't set mypy to 3.12 :D
  • Loading branch information
cooperlees committed Oct 24, 2023
1 parent dd8e989 commit 5f90169
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/release_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
- name: Print Python Version
run: python --version --version && which python

- name: Installing git CLI tool
run: |
sudo apt update
sudo apt install git
- name: Update pip, setuptools + wheels
run: |
python -m pip install --upgrade pip setuptools wheel
Expand All @@ -41,13 +46,3 @@ jobs:
python -m pip install coverage
coverage run release_tests.py
coverage report -m
- name: Run mypy strict
run: |
python -m pip install mypy
mypy --strict release.py
- name: Run black preview
run: |
python -m pip install black
black --preview release*
2 changes: 1 addition & 1 deletion release.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def cleanup_changes_template_for_release(self) -> None:
"## Unreleased", f"## {self.next_version}"
)

# Remove all comments (subheadings are harder - Human will still need to do them)
# Remove all comments (subheadings are harder - Human required still)
no_comments_changes = []
for line in versioned_changes.splitlines():
if line.startswith("<!--"):
Expand Down
7 changes: 4 additions & 3 deletions release_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
class FakeDateTime:
"""Used to mock the date to test generating next calver function"""

def today(*args: Any, **kwargs: Any) -> "FakeDateTime":
def today(self, *args: Any, **kwargs: Any) -> "FakeDateTime":
return FakeDateTime()

# Add leading 0 on purpose to ensure we remove it
def strftime(*args: Any, **kwargs: Any) -> str:
def strftime(self, *args: Any, **kwargs: Any) -> str:
return "69.01"


class TestRelease(unittest.TestCase):
def setUp(self) -> None:
self.tempdir = TemporaryDirectory(delete=False)
# We only test on >= 3.12
self.tempdir = TemporaryDirectory(delete=False) # type: ignore
self.tempdir_path = Path(self.tempdir.name)
self.sf_real_black_repo = SourceFiles(Path(__file__).parent)
self.sf = SourceFiles(self.tempdir_path)
Expand Down

0 comments on commit 5f90169

Please sign in to comment.