Skip to content

Template to build extensions to an existing OpenFisca country package

License

Notifications You must be signed in to change notification settings

openfisca/extension-template

Repository files navigation

OpenFisca Extension-Template

This repository is here to help you bootstrap your own OpenFisca extension package.

You should NOT fork it but download a copy of its source code and

  • change the name openfisca_extension_template to reflect your extension's name, e.g. openfisca_shangrila
  • empty out CHANGELOG.md
  • replace the placeholders variables and parameters to suit your own purposes

Installing

We recommend you to use an isolated environment manager to manage build and extension dependencies separately:

pipx install poetry
pipx install tox

Virtualenv

Poetry will automatically manage a virtual environment for you. Nonetheless, if you need to have more control over your dependencies, we recommend you to use a virtualenv:

manager to install OpenFisca:

poetry config settings.virtualenvs.create false
pyenv install 3.9.16
pyenv virtualenv 3.9.16 my-super-duper-extension-3.9.16
cd ~/path/where/is/my-super-duper-extension-3.9.16
pyenv local my-super-duper-extension-3.9.16

To install your extension for development, run:

poetry install --all-extras --sync

Testing

You can make sure that everything is working by running the provided tests:

poetry run openfisca test --country-package=openfisca_country_template --extensions=openfisca_extension_template openfisca_extension_template/tests

Learn more about tests.

Your extension package is now installed and ready!

Cleanup

To completely clean up your environment, run:

poetry env remove --all
pip freeze | grep -v "^-e" | sed "s/@.*//" | xargs pip uninstall -y

This will remove all pip package from current environment and remove all Poetry environment in OpenFisca Extension-Template.

About

Template to build extensions to an existing OpenFisca country package

Resources

License

Stars

Watchers

Forks

Packages

No packages published