diff options
| author | clpo13 <clpo13@gmail.com> | 2023-09-26 13:30:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-26 13:30:26 -0700 |
| commit | e274ccea56219c7d07c0e677d44c8122a699dcaf (patch) | |
| tree | f19915db2eafe895b949ced6dee183b51d3fb975 | |
| parent | 602bbbb7e387f5c126d5130c6e7193f5ae906d9c (diff) | |
| parent | 3c720f269d69f8bc505efed3f86881e530f55949 (diff) | |
| download | wikiget-e274ccea56219c7d07c0e677d44c8122a699dcaf.tar.gz wikiget-e274ccea56219c7d07c0e677d44c8122a699dcaf.zip | |
Merge pull request #7 from clpo13/dev
Merge dev branch into master
| -rw-r--r-- | README.md | 7 | ||||
| -rw-r--r-- | pyproject.toml | 41 | ||||
| -rw-r--r-- | src/wikiget/__init__.py (renamed from wikiget/__init__.py) | 0 | ||||
| -rw-r--r-- | src/wikiget/dl.py (renamed from wikiget/dl.py) | 0 | ||||
| -rw-r--r-- | src/wikiget/validations.py (renamed from wikiget/validations.py) | 0 | ||||
| -rw-r--r-- | src/wikiget/version.py (renamed from wikiget/version.py) | 0 | ||||
| -rw-r--r-- | src/wikiget/wikiget.py (renamed from wikiget/wikiget.py) | 0 | ||||
| -rw-r--r-- | tests/test_validations.py (renamed from test/test_validations.py) | 0 |
8 files changed, 22 insertions, 26 deletions
@@ -1,5 +1,6 @@ # wikiget +[](https://github.com/clpo13/wikiget/actions/workflows/python.yml) [](https://badge.fury.io/py/wikiget) Something like wget for downloading a file from MediaWiki sites (like Wikipedia @@ -93,9 +94,13 @@ source venv/bin/activate Then run `pip install -e .` to invoke an ["editable" install](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs), meaning any changes made to the source will be reflected immediately in the executable -script. Unit tests can be run with `pytest` (make sure to run `pip install pytest-cov` +script. Unit tests can be run with `pytest` (make sure to run `pip install pytest` in the virtual environment first.) +Alternatively, using [Hatch](https://hatch.pypa.io/latest/), simply clone the repository +and run `hatch run test` to create the environment and run pytest. Also try `hatch shell` +or `hatch run wikiget --help`. + ## License Copyright (C) 2018-2023 Cody Logan and contributors diff --git a/pyproject.toml b/pyproject.toml index 8b906c6..aab4b3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,6 @@ [build-system] -#requires = ["setuptools"] -#build-backend = "setuptools.build_meta" requires = ["hatchling"] build-backend = "hatchling.build" -#requires = ["pdm-backend"] -#build-backend = "pdm.backend" [project] name = "wikiget" @@ -51,21 +47,19 @@ Repository = "https://github.com/clpo13/wikiget" [project.scripts] wikiget = "wikiget.wikiget:main" -[tool.setuptools.dynamic] -version = {attr = "wikiget.version.__version__"} - [tool.hatch.version] -path = "wikiget/version.py" +path = "src/wikiget/version.py" -#[tool.pdm] -#version = { source = "file", path = "wikiget/version.py" } +[tool.pytest.ini_options] +addopts = [ + "--import-mode=importlib", +] +testpaths = ["tests"] -#[tool.pytest.ini_options] -#addopts = [ -# "--import-mode=importlib", -# "--cov=wikiget", -#] -#testpaths = ["test"] +[tool.hatch.build.targets.sdist] +exclude = [ + "/.github", +] [tool.hatch.envs.default] dependencies = [ @@ -73,8 +67,8 @@ dependencies = [ "pytest", ] [tool.hatch.envs.default.scripts] -test = "pytest {args:test}" -test-cov = "coverage run -m pytest {args:test}" +test = "python -m pytest {args}" +test-cov = "coverage run -m pytest {args}" cov-report = [ "- coverage combine", "coverage report", @@ -95,7 +89,7 @@ dependencies = [ "ruff", ] [tool.hatch.envs.lint.scripts] -typing = "mypy --install-types --non-interactive {args:wikiget test}" +typing = "mypy --install-types --non-interactive {args:src/wikiget tests}" style = [ "ruff {args:.}", "black --check --diff {args:.}", @@ -169,19 +163,16 @@ ban-relative-imports = "all" [tool.ruff.per-file-ignores] # Tests can use magic values, assertions, and relative imports -"test/**/*" = ["PLR2004", "S101", "TID252"] +"tests/**/*" = ["PLR2004", "S101", "TID252"] [tool.coverage.run] source_pkgs = ["wikiget"] branch = true parallel = true -omit = [ - "wikiget/version.py", -] [tool.coverage.paths] -hatchtest = ["wikiget"] -tests = ["test"] +wikiget = ["wikiget"] +tests = ["tests"] [tool.coverage.report] exclude_lines = [ diff --git a/wikiget/__init__.py b/src/wikiget/__init__.py index b68b0ec..b68b0ec 100644 --- a/wikiget/__init__.py +++ b/src/wikiget/__init__.py diff --git a/wikiget/dl.py b/src/wikiget/dl.py index 949f09e..949f09e 100644 --- a/wikiget/dl.py +++ b/src/wikiget/dl.py diff --git a/wikiget/validations.py b/src/wikiget/validations.py index dc70df4..dc70df4 100644 --- a/wikiget/validations.py +++ b/src/wikiget/validations.py diff --git a/wikiget/version.py b/src/wikiget/version.py index dd9b22c..dd9b22c 100644 --- a/wikiget/version.py +++ b/src/wikiget/version.py diff --git a/wikiget/wikiget.py b/src/wikiget/wikiget.py index ba36766..ba36766 100644 --- a/wikiget/wikiget.py +++ b/src/wikiget/wikiget.py diff --git a/test/test_validations.py b/tests/test_validations.py index 1abd96a..1abd96a 100644 --- a/test/test_validations.py +++ b/tests/test_validations.py |
