Skip to content

Commit

Permalink
fix: tasks invoke script
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-RA-King committed Jun 10, 2023
1 parent 01b8a54 commit 433d68b
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 22 deletions.
37 changes: 37 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "monthly"
time: "08:00"
timezone: "Europe/London"
labels:
- "dependencies"
- "github_actions"
open-pull-requests-limit: 99
target-branch: "main"

- package-ecosystem: pip
directory: "/docs"
schedule:
interval: "monthly"
time: "08:00"
timezone: "Europe/London"
labels:
- "dependencies"
- "python"
open-pull-requests-limit: 99
target-branch: "main"

- package-ecosystem: pip
directory: "/"
schedule:
interval: "monthly"
time: "08:00"
timezone: "Europe/London"
labels:
- "dependencies"
- "python"
open-pull-requests-limit: 99
target-branch: "develop"
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ build-backend = "setuptools.build_meta"
[tool.black]
line-length = 88

[tool.pytest.ini_options]
# https://docs.pytest.org/en/6.2.x/reference.html?highlight=minversion#configuration-options
minversion = "6.0"
testpaths = [
"tests",
]


[tool.isort]
import_heading_stdlib = "Core Library modules"
Expand Down Expand Up @@ -52,8 +47,14 @@ warn_unused_configs = true
disallow_untyped_calls = false
disallow_incomplete_defs = true
follow_imports = "skip"
html_report = "mypy-report"
html_report = "reports/mypy"
cache_dir = 'cache/.mypy_cache'
mypy_path = "typeshed/pyi:typeshed/imports"
exclude = [
'^tests/[\w]*.py$',
'^tools/[\w]*.py$',
'^tasks.py$'
]

[tool.semantic_release]
version_variable = [
Expand Down
22 changes: 19 additions & 3 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
[pytest]
xfail_strict = true
junit_family = xunit1
filterwarnings = ignore:.*U.*mode is deprecated:DeprecationWarning
addopts =
--strict-markers
--strict-config
-ra
--cov
--cov-report html:reports/coverage
--html=reports/pytest.html
--capture=tee-sys

norecursedirs = .git .* *.egg* docs dist build

testpaths = tests

pythonpath = src
markers =
xpass: marks test as expected pass
dependency: marks a test as a dependency
filterwarnings = error

minversion = 7.3.1

cache_dir = cache/.pytest_cache
12 changes: 10 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@ author = Stephen R A King
author_email = sking.github@gmail.com
maintainer = Stephen R A King
maintainer_email = sking.github@gmail.com
description = Utility command line tool to manage python versions
description = Utility command line tool to manage python versions and virtual environments
long_description = file: README.md
long_description_content_type = text/markdown
keywords = utility,
keywords = python-version-management,python-version-manager,virtualenv-manager,python-version-selector,python-versions,python-environment
platforms = windows
url = https://github.com/stephen-ra-king/pynball
download_url =
license = MIT
license_files = LICENSE
project_urls =
documentation = https://pynamer.readthedocs.io/en/latest/
Release Notes = https://github.com/Stephen-RA-King/pynamer/releases
Source Code = https://github.com/Stephen-RA-King/pynamer/
Issue Tracker = https://github.com/Stephen-RA-King/pynamer/issues

# https://pypi.org/pypi?%3Aaction=list_classifiers
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: Microsoft :: Windows
Topic :: System :: Installation/Setup
Natural Language :: English
Expand All @@ -27,6 +34,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11

[options]
package_dir=
Expand Down
21 changes: 13 additions & 8 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Third party modules
import yaml # type: ignore
from invoke import call, task
from invoke import task, call
from jinja2 import Template

ROOT_DIR = Path(__file__).parent
Expand All @@ -25,7 +25,7 @@
LOG_DIR = ROOT_DIR.joinpath("logs")
TEST_DIR = ROOT_DIR.joinpath("tests")
SRC_DIR = ROOT_DIR.joinpath("src")
PKG_DIR = SRC_DIR.joinpath("piptools_sync")
PKG_DIR = SRC_DIR.joinpath("pynball")
PYTHON_FILES_ALL = list(ROOT_DIR.rglob("*.py"))
PYTHON_FILES_ALL.remove(ROOT_DIR / "tasks.py")
PYTHON_FILES_ALL_STR = ""
Expand Down Expand Up @@ -83,7 +83,7 @@
logger.debug("Total python files: %s", len(PYTHON_FILES_ALL))
for file in PYTHON_FILES_ALL:
logger.debug("%s", file)
logger.debug("Total python files: %s", len(PYTHON_FILES_SRC))
logger.debug("src python files: %s", len(PYTHON_FILES_SRC))
for file in PYTHON_FILES_SRC:
logger.debug("%s", file)

Expand All @@ -104,7 +104,7 @@ def _delete_director(items_to_delete):
def _finder(directory, item, exclusions):
"""Utility function to generate a Path list of files based on globs."""
item_list = list(directory.rglob(item))
logger.debug("for %s: Found: %s", item, item_list)
logger.debug("for %s : Found: %s", item, item_list)
for exc in exclusions:
logger.debug("removing exclusion: %s", exc)
if exc in item_list:
Expand Down Expand Up @@ -137,7 +137,7 @@ def _clean_build():
]
# specify pathlib objects to exclude from deletion (can be directories of files)
excludes = [
SRC_DIR / "piptools_sync.egg-info/",
SRC_DIR / "pynball.egg-info/",
]
for pattern in patterns:
_finder(ROOT_DIR, pattern, excludes)
Expand All @@ -146,14 +146,19 @@ def _clean_build():
def _clean_test():
"""Clean up test artifacts."""
patterns = [
"assets",
"coverage",
"mypy",
".pytest_cache",
"htmlcov",
".tox",
".coverage",
".tox",
"coverage.xml",
"pytest-report.html",
"coverage.html",
"pytest.html",
"coverage.html",
]
excludes = []
excludes = [ROOT_DIR / "assets", ROOT_DIR / "docs" / "assets"]
for pattern in patterns:
_finder(ROOT_DIR, pattern, excludes)

Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ markers =

[testenv]
deps =
-r requirements/requirements_tox.txt
-r requirements/test.txt
commands =
pip install -e .
pytest .
safety

[testenv:linter]
deps =
-r requirements/requirements_tox.txt
-r requirements/test.txt
commands =
flake8
black --check .
Expand Down

0 comments on commit 433d68b

Please sign in to comment.