Introduction
Usage, etc.
We're installed with pipenv, a handy wrapper
around pip and virtualenv. Install that first with pip3 install pipenv
. Then run:
PIPENV_VENV_IN_PROJECT=1 pipenv install --python 3.8 --dev
In case you do not have python 3.8 on your machine, install python using pyenv and try the previous command again. See install pyenv below for instructions.
There will be a script you can run like this::
pipenv run shrinky -p /dataset/something.gpkg -r "table_a:2,3,4;table_b:4,3,6"
pipenv run parse_validation_result -r /dataset/validation.json
It runs the main()
function in shrinky/scripts.py
,
adjust that if necessary. The script is configured in setup.py
(see
entry_points
).
In order to get nicely formatted python files without having to spend manual work on it, run the following command periodically:
pipenv run black shrinky
Run the tests regularly. This also checks with pyflakes, black and it reports coverage. Pure luxury:
pipenv run pytest
If you need a new dependency (like requests
), add it in setup.py
in
install_requires
. Afterwards, run install again to actually install your
dependency:
pipenv install --dev
Pipenv installs zest.releaser which allows you to release the package to a git(hub) repo. It has a
fullrelease
command that asks you a few questions, which you all respond to with <enter>
:
pipenv run fullrelease
We can install pyenv by running the following commands:
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
Also make sure to put pyenv in your .bashrc
or .zshrc
as instructed by the previous commands.
-
Add a new project on https://github.com/PDOK/ with the same name. Set visibility to "public" and do not generate a license or readme.
Note: "public" means "don't put customer data or sample data with real persons' addresses on github"!
-
Follow the steps you then see (from "git init" to "git push origin master") and your code will be online.
-
Go to https://github.com/PDOK/shrinky/settings/collaboration and add the teams with write access (you might have to ask someone with admin rights to do it).
-
Once you installed with pipenv, add Pipfile.lock to git:
git add Pipfile.lock
and commit it to your repo. -
Update this readme. Use markdown as the format.
-
Ask Roel for a review.
-
Remove this section as you've done it all :-)