drym-org / old-abe

Accounting prototype for attribution-based economics
6 stars 2 forks source link

Project shell for building, running tests, etc. #3

Closed countvajhula closed 1 year ago

countvajhula commented 1 year ago

This is copied over from composer, which I set up this way a few years ago. I'm not sure if all of the patterns used are up to date with the python ecosystem today, but I was able to run tests and lint and things like that. Looking at it now, there are a few nice development features in it:

... assuming these all still work correctly. We'll probably find out when we start writing tests!

Here's the full output from running make (defaults to make help) showing all the options:

clean - remove all build, test, coverage and Python artifacts
build - install package and dependencies for local development
docs - generate Sphinx HTML documentation, including API docs
clean - clean all build and test artifacts
clean-build - remove build artifacts
clean-pyc - remove Python file artifacts
clean-test - remove test and coverage artifacts
lint-source - check style for source with flake8
lint-tests - check style for tests with flake8
lint-all - check style with flake8
lint - alias for lint-source
black - run black auto-formatting on all code
test-unit - run unit tests
test - run specified tests, e.g.:
       make test DEST=tests/unit/my_module.py
       (defaults to unit tests if none specified)
test-stop - run tests and stop on the first failure
test-debug - run specified tests and enter debugger on the first failure. e.g.
             make test-debug DEST=tests/unit/my_module.py
             (defaults to unit tests if none specified)
test-matrix - run tests on every Python version with tox
test-tldr - run specified tests and output just the stacktrace, e.g.
             make test-tldr DEST=tests/unit/my_module.py
             (defaults to unit tests if none specified)
debug - alias for test-debug
tldr - alias for test-tldr
coverage - check code coverage quickly with the default Python
sdist - package

Btw, the repo and the files were originally named using dashes instead of underscores. The dashes actually seem to be a syntax error in python (e.g. from money-in import ... was showing as an error). So I changed all the module names to use underscores, for now. Also, PEP8 discourages even underscores for package names, so we might need to rename the repo to oldabe instead of old-abe. Alternatively, I think we can keep the repo name but only change the contained folder to oldabe (which this PR does), but as that might cause confusion down the line maybe we should just rename everything to oldabe?