Skip to content

Commit

Permalink
Fix GH actions unittesting (#29)
Browse files Browse the repository at this point in the history
* update testing job to always generate coverage map

* restrict scan path of coverage

* add missing test dependencies during testing

* replace deprecated distutils methods
  • Loading branch information
HeliosLHC authored Jan 14, 2024
1 parent c3ae6ca commit 3484602
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,20 @@ jobs:
python -m pip install --upgrade pip
pip install --no-binary lxml lxml
pip install coverage
pip install .
pip install .["testing"]
- name: Run unittests with coverage report
continue-on-error: true
# continue-on-error: true
run: |
coverage run -m unittest discover -p "*_test.py"
coverage run --include="./wpull/**/*.py" -m unittest discover -p "*_test.py"
- name: Generate coverage report
if: always()
run: |
coverage xml --data-file=.coverage
# You can test your matrix by printing the current Python version
# - name: Display Python version
# run: python -c "import sys; print(sys.version)"
- name: Get Cover
if: always()
uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
Expand Down
4 changes: 2 additions & 2 deletions freezer/pyinstaller/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import copy
import subprocess
import sys
import distutils.util
import sysconfig
import platform
import os.path
import os
Expand Down Expand Up @@ -88,7 +88,7 @@ def run_env(args):
print('Zip.')
wpull_version = run_env_py(['wpull', '--version'], get_output=True)\
.decode('ascii').strip()
platform_string = distutils.util.get_platform()
platform_string = sysconfig.get_platform()
python_version = platform.python_version()
date_string = time.strftime('%Y%m%d%H%M%S', time.gmtime())
zip_name = 'wpull-{}-{}-{}-{}'.format(
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ docs = [
"sphinxcontrib-napoleon>=0.2.6,<=0.5.0",
]
testing = [
"warcat",
"warcat"
]

[tool.setuptools]
Expand Down Expand Up @@ -74,4 +74,9 @@ Source = "https://github.com/ArchiveTeam/ludios_wpull"

[project.scripts]
wpull = "wpull.application.main:main"
wpull4 = "wpull.application.main:main"
wpull5 = "wpull.application.main:main"

[tool.coverage.run]
omit = [
"index_html.generated.py"
]
4 changes: 2 additions & 2 deletions wpull/version_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# encoding=utf-8
from distutils.version import StrictVersion
from packaging.version import parse
import unittest

import wpull.version
Expand All @@ -8,7 +8,7 @@

class TestVersion(unittest.TestCase):
def test_valid_version_str(self):
StrictVersion(wpull.version.__version__)
parse(wpull.version.__version__)

def test_version_string_buidler(self):
self.assertEqual(
Expand Down

0 comments on commit 3484602

Please sign in to comment.