M Makefile => Makefile +37 -16
@@ 1,32 1,53 @@
+VERSION=1.0.2
-unittest = unittest --color
-#unittest = python -m unittest
-unittest_discover = unittest --color --working-directory .
-#unittest_discover = python -m unittest discover tests --top-level-directory . --start-directory
-python = python3
+PY_COMPILE_BIN=python -m py_compile
+#BUILD_BIN=python -m build
+BUILD_BIN=pyproject-build
+
+#UNITTEST_FILE_BIN=python -m unittest
+#UNITTEST_DIR_BIN=python -m unittest discover --top-level-directory .
+UNITTEST_FILE_BIN=unittest --color
+UNITTEST_DIR_BIN=unittest --color --working-directory .
+
+#MYPY_BIN=python -m mypy
+MYPY_BIN=MYPY_CACHE_DIR=gap/__mypycache__ mypy
+
+#PIPX_BIN=python -m pipx
+PIPX_BIN=pipx
+
+.PHONY: clean
clean:
- rm -rf **/__pycache__ **/__mypycache__ **/*.pyc build dist filters.egg-info
+ rm -rf **/__pycache__ **/__mypycache__ **/*.pyc build *.egg-info
+.PHONY: test
test:
- $(python) -m py_compile filter/*.py rng/*.py
- #$(unittest_discover) tests
+ $(PY_COMPILE_BIN) filter/*.py rng/*.py
-build:
+filter/cli.py: filter/cli.toml
gap filter/cli.toml --no-debug-mode --output=filter/cli.py
+
+rng/cli.py: rng/cli.toml
gap rng/cli.toml --no-debug-mode --output=rng/cli.py
- $(python) setup.py sdist bdist_wheel
-unittest:
- $(unittest_discover) tests --verbose
- $(unittest) tests/generated_syntax_tests.py --verbose
+PY_FILES=rng/__main__.py rng/cli.py rng/internals.py rng/normal.py rng/notrandom.py rng/uniform.py filter/__main__.py filter/ab.py filter/cli.py filter/convolve.py filter/internals.py filter/kalman.py
+PYBUILD_FILES=pyproject.toml README.md LICENSE.md
+
+build/filters-$(VERSION)-py3-none-any.whl: $(PY_FILES) $(PYBUILD_FILES)
+ mkdir -p build
+ $(BUILD_BIN) --wheel --no-isolation --outdir build/
+.PHONY: build
+build: build/filters-$(VERSION)-py3-none-any.whl
+
+.PHONY: reinstall
reinstall: uninstall install
-install:
- pipx install .
+.PHONY: install
+install: build/filters-$(VERSION)-py3-none-any.whl
+ pipx install build/filters-$(VERSION)-py3-none-any.whl
+.PHONY: uninstall
uninstall:
pipx uninstall filters
-
M README.md => README.md +1 -11
@@ 1,8 1,6 @@
# filters
-## Commands
-
-### filter
+## Usage
```
filter METHOD [OPTIONS]
@@ 12,10 10,6 @@ Command line data filtering.
Available `METHOD`s are: `ab`, `kalman`, and `convolve`. Use `filter METHOD --help` to see available options.
-
-
-### rng
-
```
rng DISTRIBUTION [OPTIONS]
```
@@ 25,8 19,6 @@ Command line data generation.
Available `DISTRIBUTION`s are: `normal`, `uniform`, and `notrandom`. Use `rng DISTRIBUTION --help` to see available options.
-----
-
## Example
```sh
@@ 50,8 42,6 @@ Raw: Est.:
```
-----
-
## Licensing
This software is distributed under the GPL license.
A pyproject.toml => pyproject.toml +21 -0
@@ 0,0 1,21 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[tool.setuptools]
+packages = ["filter", "rng"]
+
+[project]
+name = "filters"
+description = "Command line data filtering and generation"
+readme = "README.md"
+version = "1.0.2"
+authors = [ { name = "Dominic Ricottone", email = "me@dominic-ricottone.com" } ]
+urls = { source = "git.dominic-ricottone.com/~dricottone/filters" }
+license = { file = "LICENSE.md" }
+requires-python = ">=3.6"
+
+[project.scripts]
+filter = "filter.__main__:main"
+rng = "rng.__main__:main"
+
D requirements.txt => requirements.txt +0 -2
@@ 1,2 0,0 @@
-setuptools>=47.1.1
-
D setup.py => setup.py +0 -23
@@ 1,23 0,0 @@
-#!/usr/bin/env python3
-
-from setuptools import setup
-
-long_description = None
-with open('README.md', encoding='utf-8') as f:
- long_description = f.read()
-
-setup(
- name="filters",
- packages=["filter", "rng"],
- version="1.0.1",
- license="GPL",
- description="Data filters",
- long_description=long_description,
- long_description_content_type='text/markdown',
- author="Dominic Ricottone",
- author_email="me@dominic-ricottone.com",
- url="git.dominic-ricottone.com/filters",
- entry_points={"console_scripts": ["filter = filter.__main__:main", "rng = rng.__main__:main"]},
- python_requires=">=3.6",
-)
-