From 50212d1770524cfbfc9cf02cbcaff9c34407464f Mon Sep 17 00:00:00 2001 From: pzuldp Date: Tue, 23 Jul 2024 07:49:05 +0000 Subject: [PATCH] Customise country-template through CI --- .flake8 | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/first-time-setup.yml | 36 - CHANGELOG.md | 727 ------------------ CONTRIBUTING.md | 8 +- MANIFEST.in | 2 +- Makefile | 6 +- README.md | 56 +- first-time-setup.sh | 130 ---- .../__init__.py | 4 +- .../entities.py | 0 .../parameters/benefits/basic_income.yaml | 0 .../benefits/housing_allowance.yaml | 0 .../parameters/benefits/index.yaml | 0 .../benefits/parenting_allowance/amount.yaml | 0 .../parenting_allowance/income_threshold.yaml | 0 .../parameters/general/age_of_majority.yaml | 0 .../parameters/general/age_of_retirement.yaml | 0 .../parameters/taxes/housing_tax.yaml | 0 .../parameters/taxes/income_tax_rate.yaml | 0 .../taxes/social_security_contribution.yaml | 0 .../reforms/__init__.py | 0 .../reforms/add_dynamic_variable.py | 2 +- .../reforms/add_new_tax.py | 2 +- .../flat_social_security_contribution.py | 0 .../modify_social_security_taxation.py | 0 .../reforms/removal_basic_income.py | 0 .../situation_examples/__init__.py | 0 .../situation_examples/couple.json | 0 .../situation_examples/housing.json | 0 .../situation_examples/single.json | 0 .../tests/age.yaml | 0 .../tests/basic_income.yaml | 0 .../tests/disposable_income.yaml | 0 .../tests/housing_allowance.yaml | 0 .../tests/housing_tax.yaml | 0 .../tests/income_tax.yaml | 0 .../tests/reforms/add_dynamic_variable.yaml | 2 +- .../tests/reforms/add_new_tax.yaml | 4 +- .../modify_social_security_taxation.yaml | 6 +- .../tests/situations/income_tax.yaml | 0 .../tests/situations/parenting_allowance.yaml | 0 .../tests/social_security_contribution.yaml | 0 .../variables/__init__.py | 0 .../variables/benefits.py | 2 +- .../variables/demographics.py | 2 +- .../variables/housing.py | 2 +- .../variables/income.py | 2 +- .../variables/stats.py | 2 +- .../variables/taxes.py | 2 +- pyproject.toml | 22 +- 51 files changed, 46 insertions(+), 977 deletions(-) delete mode 100644 .github/workflows/first-time-setup.yml delete mode 100755 first-time-setup.sh rename {openfisca_country_template => openfisca_france_firms}/__init__.py (93%) rename {openfisca_country_template => openfisca_france_firms}/entities.py (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/benefits/basic_income.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/benefits/housing_allowance.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/benefits/index.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/benefits/parenting_allowance/amount.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/benefits/parenting_allowance/income_threshold.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/general/age_of_majority.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/general/age_of_retirement.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/taxes/housing_tax.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/taxes/income_tax_rate.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/parameters/taxes/social_security_contribution.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/reforms/__init__.py (100%) rename {openfisca_country_template => openfisca_france_firms}/reforms/add_dynamic_variable.py (96%) rename {openfisca_country_template => openfisca_france_firms}/reforms/add_new_tax.py (96%) rename {openfisca_country_template => openfisca_france_firms}/reforms/flat_social_security_contribution.py (100%) rename {openfisca_country_template => openfisca_france_firms}/reforms/modify_social_security_taxation.py (100%) rename {openfisca_country_template => openfisca_france_firms}/reforms/removal_basic_income.py (100%) rename {openfisca_country_template => openfisca_france_firms}/situation_examples/__init__.py (100%) rename {openfisca_country_template => openfisca_france_firms}/situation_examples/couple.json (100%) rename {openfisca_country_template => openfisca_france_firms}/situation_examples/housing.json (100%) rename {openfisca_country_template => openfisca_france_firms}/situation_examples/single.json (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/age.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/basic_income.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/disposable_income.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/housing_allowance.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/housing_tax.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/income_tax.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/reforms/add_dynamic_variable.yaml (80%) rename {openfisca_country_template => openfisca_france_firms}/tests/reforms/add_new_tax.yaml (79%) rename {openfisca_country_template => openfisca_france_firms}/tests/reforms/modify_social_security_taxation.yaml (71%) rename {openfisca_country_template => openfisca_france_firms}/tests/situations/income_tax.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/situations/parenting_allowance.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/tests/social_security_contribution.yaml (100%) rename {openfisca_country_template => openfisca_france_firms}/variables/__init__.py (100%) rename {openfisca_country_template => openfisca_france_firms}/variables/benefits.py (98%) rename {openfisca_country_template => openfisca_france_firms}/variables/demographics.py (97%) rename {openfisca_country_template => openfisca_france_firms}/variables/housing.py (96%) rename {openfisca_country_template => openfisca_france_firms}/variables/income.py (96%) rename {openfisca_country_template => openfisca_france_firms}/variables/stats.py (96%) rename {openfisca_country_template => openfisca_france_firms}/variables/taxes.py (98%) diff --git a/.flake8 b/.flake8 index cd91d60..cdd268c 100644 --- a/.flake8 +++ b/.flake8 @@ -6,7 +6,7 @@ inline-quotes = " multiline-quotes = """ import-order-style = appnexus no-accept-encodings = true -application-import-names = openfisca_country_template +application-import-names = openfisca_france_firms application-package-names = openfisca_core exclude = .git,__pycache__,.venv,.github,.devcontainer,docs diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 413f6ba..59f5d47 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,7 +11,7 @@ Thanks for contributing to OpenFisca ! Please remove this line, as well as, for These changes _(remove lines which are not relevant to your contribution)_: -- Impact the OpenFisca-Country-Template public API (for instance renaming or removing a variable) +- Impact the OpenFisca-France Firms public API (for instance renaming or removing a variable) - Add a new feature (for instance adding a variable) - Fix or improve an already existing calculation. - Change non-functional parts of this repository (for instance editing the README) diff --git a/.github/workflows/first-time-setup.yml b/.github/workflows/first-time-setup.yml deleted file mode 100644 index 31b5537..0000000 --- a/.github/workflows/first-time-setup.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: First time setup - -on: - create: - workflow_dispatch: - -permissions: - actions: write - checks: write - contents: write - -jobs: - first-time-setup: - # Ensure this job does not run on the template repository or when the repository is forked - if: ${{ !github.event.repository.is_template && !github.event.repository.fork }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Infer jurisdiction name from repository name - run: | - echo "TITLE_CASE_JURISDICTION_NAME=$(echo ${{ github.event.repository.name }} | sed 's/openfisca-//' | sed 's/[-|_]/ /g' | awk '{for (i=1; i<=NF; i++) $i=toupper(substr($i,1,1)) substr($i,2)} 1')" >> $GITHUB_ENV - - - name: Execute the first-time-setup script - run: CI=true JURISDICTION_NAME="$TITLE_CASE_JURISDICTION_NAME" REPOSITORY_URL="${{ github.repositoryUrl }}" ./first-time-setup.sh - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: "Customise country-template through CI" - tagging_message: "0.0.1" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 71125b9..7b9c0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,730 +1,3 @@ -# Changelog - -### 7.1.3 [#152](https://github.com/openfisca/country-template/pull/147) - -* Technical improvement. -* Details: - - Update classifiers in pyproject.toml to include all supported versions of python - -### 7.1.2 [#147](https://github.com/openfisca/country-template/pull/147) - -* Technical improvement -* Details: - - Skip `deploy` workflow when PyPI token is not defined in GitHub secrets - - Ensure lint scripts work properly without reachable tags - - Rename the GitHub secret `PYPI_TOKEN_OPENFISCA_BOT` used in `deploy` workflow to `PYPI_TOKEN` - - Update deprecated syntax in GitHub Actions workflow - -### 7.1.1 [#146](https://github.com/openfisca/country-template/pull/146) - -* Technical improvement -* Details: - - Update minimal Core dependency to require a version that can parse `pyproject.toml` (see https://github.com/openfisca/openfisca-core/pull/1209) - - Use version specifiers compatible with Conda packaging - -## 7.1.0 [#143](https://github.com/openfisca/country-template/pull/143) - -* Technical improvement -* Minor change -* Details: - - Automate template setup process via CI for GitHub users: - - When creating a new repository by using this template on GitHub, the setup script is automatically executed by the CI on the resulting generated repository. - - Improve accessibility by adopting less technical terminology: - - Replace "bootstrap" with "first-time setup", clarifying its purpose as a one-time project initialisation, particularly for users unfamiliar with the technical vocabulary. - - Decompose GitHub Actions monolithic workflow into specialized workflows: - - Split the `Country-Template` workflow into three distinct workflows: `build`, `validate` and `deploy`. - - Enhance accuracy of workflow triggers: - - Trigger deployment only when changes are pushed to the `main` branch. - - Trigger validation on PR events or as a dependency of the deployment workflow. - - Update CI dependencies - - -# 7.0.0 [#139](https://github.com/openfisca/country-template/pull/139) - -* Technical improvement -* Major change -* Details: - - Make template setup process interactive - - Replace `master` branch with `main` - - Replace `setup.py` and `setup.cfg` with `pyproject.toml` - - Remove references to `OpenFisca France` - - Alter `README.md` to allow for improved text replacements - - Lint files - - Add an example entry to the changelog ([#116](https://github.com/openfisca/country-template/issues/116) - - Relax Python version constraint - - -### 6.0.3 [#136](https://github.com/openfisca/country-template/pull/136) - -* Technical improvement. -* Details: - - Update openfisca-core version >= 41.0 - - -### 6.0.2 [#132](https://github.com/openfisca/country-template/pull/132) - -* Technical improvement. -* Impacted areas: template setup script -* Details: - - Allows country-template to pass `check-style` makefile command - -### 6.0.1 [#134](https://github.com/openfisca/country-template/pull/134) - -* Technical improvement. -* Impacted areas: template replacement script -* Details: - - Avoid `sed: RE error: illegal byte sequence` error when template contains `.DS_Store` files after GUI navigation in macOS - -# 6.0.0 [#129](https://github.com/openfisca/country-template/pull/129) - -* Technical improvement. -* Impacted periods: all. -* Impacted areas: all. -* Details: - - Upgrade every dependencies & use their latest versions to use Python 3.9 and 3.10 and drop support of Python versions < 3.9 . - -# 5.0.0 [#128](https://github.com/openfisca/country-template/pull/128) - -#### New features - -- Upgrade Web API specification to OpenAPI v3. - -#### Breaking changes - -- Drop support for OpenAPI specification v2 and prior. - - Users relying on OpenAPI v2 can use [Swagger Converter](https://converter.swagger.io/api/convert?url=OAS2_YAML_OR_JSON_URL) to migrate ([example](https://web.archive.org/web/20221103230822/https://converter.swagger.io/api/convert?url=https://api.demo.openfisca.org/latest/spec)). - -# 4.0.0 - [#127](https://github.com/openfisca/country-template/pull/127) - -#### Breaking change - -* Technical improvement. -* Details: - - Expire deprecated class `Bracket`. - - Functionality is now provided by `ParameterScaleBracket` - -### 3.13.3 - [#122](https://github.com/openfisca/country-template/pull/122) - -* Technical improvement. -* Details: - - Add pull request as GitHub Actions workflow trigger - -### 3.13.2 - [#123](https://github.com/openfisca/country-template/pull/123) - -* Technical improvement. -* Details: - - Add tar.gz to PyPi to be used by conda to build conda package. - -### 3.13.1 - [#120](https://github.com/openfisca/country-template/pull/120) - -* Minor change -* Details: - - Delete macOS related comment in bootstrap script - -## 3.13.0 - [#115](https://github.com/openfisca/country-template/pull/115) - -* Technical improvement. -* Details: - - Switch continuous integration pipeline from CircleCI to GitHub Actions - -### 3.12.10 - [#119](https://github.com/openfisca/country-template/pull/119) - -* Technical improvement. -* Details: - - Update README - - Add encoding to open json files - -### 3.12.9 - [#113](https://github.com/openfisca/country-template/pull/113) - -* Technical improvement. -* Details: - - Add a Web API smoke test to the CI. - -### 3.12.8 - [#105](https://github.com/openfisca/country-template/pull/105) - -* Minor change. -* Details: - - Upgrade `flake8-print` - -### 3.12.7 - [#104](https://github.com/openfisca/country-template/pull/104) - -* Minor change. -* Details: - - Upgrade `flake8-bugbear` - -### 3.12.6 - [#102](https://github.com/openfisca/country-template/pull/102) - -* Bug fix. -* Impacted periods: all. -* Impacted areas: `openfisca_country_template/variables/benefits.py`. -* Details: - - Fixes `parenting_allowance` formula syntax. - - Uses vectorial computing to return a `parenting_allowance` amount per household. - -### 3.12.5 - [#107](https://github.com/openfisca/country-template/pull/107) - -* Technical improvement. -* Details: - - Forces the installation of the new build each time `make build` is run. - - CircleCI tests against the packaged version of this library. - - When a branch is pushed first time, CircleCI creates a build and caches dependencies. - - Subsequent pushes do not reinstall the build as it is already in cache. - - If the code has been modified in between, changes will be ignored, and tests will fail. - -### 3.12.4 - [#103](https://github.com/openfisca/country-template/pull/103) - -* Minor change. -* Details: - - Fix CHANGELOG versions: - - `3.13.0` was supposed to be `3.12.3`. - - `3.12.0` and `3.12.1` are unpublished. - -### 3.12.3 - [#97](https://github.com/openfisca/country-template/pull/97) - -* Technical improvement. -* Impacted areas: `**/*`. -* Details: - - Make style checks stricter and clearer to help country package developers get started. - -### 3.12.2 - [#99](https://github.com/openfisca/country-template/pull/99) - - * Technical improvement. - * Impacted areas: tests/variables and parameters. - * Details: - - Add a new variable called parenting_allowance to show how group entities and single entities can be used together. - - This variable calls the household_income variable. - -### 3.12.1 - - -> Note: Version `3.12.1` wasn't unpublished by mistake. Please use version `3.12.2` or more recent. - -## 3.12.0 - - -> Note: Version `3.12.0` wasn't unpublished by mistake. Please use version `3.12.2` or more recent. - -## 3.11.0 - [#90](https://github.com/openfisca/country-template/pull/90) - -* Technical change -* Details: - - Declare package compatible with OpenFisca-Core v35 that updates `numpy` dependency. - -## 3.10.0 - [#98](https://github.com/openfisca/country-template/pull/98) - -* Tax and benefit system evolution. -* Impacted periods: all. -* Impacted areas: `reforms/add_new_tax.py`. -* Details: - - Add a new reform example creating a variable (there was none prior). - - The example is a new tax that adds a fixed 100.0 of the country's currency to the actual income tax. - -### 3.9.13 - [#96](https://github.com/openfisca/country-template/pull/96) - -* Technical improvement. -* Impacted areas: `**/*`. -* Details: - - Remove wildcard imports as they're considered and [anti-pattern](https://docs.quantifiedcode.com/python-anti-patterns/maintainability/from_module_import_all_used.html). - -### 3.9.12 - [#93](https://github.com/openfisca/country-template/pull/93) - -* Minor change. -* Details: - - Upgrade `autopep8`, `flake8` & `pycodestyle`. - -### 3.9.11 - [#94](https://github.com/openfisca/country-template/pull/94) - -* Minor change. -* Details: - - Fix `make test` warning by updating OpenFisca test command. - -### 3.9.10 - [#86](https://github.com/openfisca/country-template/pull/86) - -* Technical change. -* Details: - - Fix installation and building operations by fixing the bootstrap script. - -### 3.9.9 - [#85](https://github.com/openfisca/country-template/pull/85) - -* Minor change. -* Details: - - Add `make serve-local` command to Makefile. - -### 3.9.8 - [#83](https://github.com/openfisca/country-template/pull/83) - -* Minor change. -* Details: - - Add additional example JSON file; add to README. - -### 3.9.7 - [#80](https://github.com/openfisca/country-template/pull/80) - -* Minor change. -* Details: - - Upgrade `autopep8`. - -### 3.9.6 - [#78](https://github.com/openfisca/country-template/pull/78) - -* Minor change. -* Details: - - Declare package compatible with Core v34. - -### 3.9.5 - [#76](https://github.com/openfisca/country-template/pull/76) - -* Minor change. -* Details: - - Declare package compatible with Core v32. - -### 3.9.4 - [#75](https://github.com/openfisca/country-template/pull/75) - -* Minor change. -* Details: - - Upgrade `autopep8`. - -### 3.9.3 - [#73](https://github.com/openfisca/country-template/pull/73) - -* Minor change. -* Details: - - Upgrade `autopep8`. - -### 3.9.2 - [#71](https://github.com/openfisca/country-template/pull/71) - -* Minor change. -* Details: - - Upgrade `flake8` and `pycodestyle`. - -### 3.9.1 - [#74](https://github.com/openfisca/country-template/pull/74) - -* Minor change. -* Details: - - Explicit expected test output. - -## 3.9.0 - [#72](https://github.com/openfisca/country-template/pull/72) - -* Technical change. -* Details: - - Declare package compatible with Core v31. - -## 3.8.0 - [#69](https://github.com/openfisca/country-template/pull/69) - -* Technical change. -* Details: - - Declare package compatible with Core v27. - -## 3.7.0 - [#68](https://github.com/openfisca/country-template/pull/68) - -* Technical change. -* Details: - - Declare package compatible with Core v26. - - Remove Python 2 checks from continuous integration. - -## 3.6.O - [#66](https://github.com/openfisca/country-template/pull/66) - -* Minor change. -* Details: - - Adapt to OpenFisca Core v25. - - Change the syntax of OpenFisca YAML tests. - -For instance, a test that was using the `input_variables` and the `output_variables` keywords like: - -```yaml -- name: Basic income - period: 2016-12 - input_variables: - salary: 1200 - output_variables: - basic_income: 600 -``` - -Becomes: - -```yaml -- name: Basic income - period: 2016-12 - input: - salary: 1200 - output: - basic_income: 600 -``` - -A test that was fully specifying its entities like: - -```yaml -name: Housing tax - period: 2017-01 - households: - - parents: [ Alicia ] - children: [ Michael ] - persons: - - id: Alicia - birth: 1961-01-15 - - id: Michael - birth: 2002-01-15 - output_variables: - housing_tax: - 2017: 1000 -``` - -Becomes: - -```yaml -name: Housing tax - period: 2017-01 - input: - household: - parents: [ Alicia ] - children: [ Michael ] - persons: - Alicia: - birth: 1961-01-15 - Michael: - birth: 2002-01-15 - output: - housing_tax: - 2017: 1000 -``` - -### 3.5.4 - [#65](https://github.com/openfisca/country-template/pull/65) - -* Minor change. -* Details: - - Update links to the doc. - -### 3.5.3 - [#64](https://github.com/openfisca/country-template/pull/64) - -* Minor change. -* Details: - - Document housing tax. - -### 3.5.2 - [#59](https://github.com/openfisca/country-template/pull/59) [#62](https://github.com/openfisca/country-template/pull/62) [#63](https://github.com/openfisca/country-template/pull/63) - -* Technical change. -* Details: - - Tests library against its packaged version. - - By doing so, we prevent some hideous bugs. - -> Note: Version `3.5.1` has been unpublished as it accidentally introduced a bug. Please use version `3.5.2` or more recent. - -## 3.5.0 - [#58](https://github.com/openfisca/country-template/pull/58) - -* Technical change. - - In the `/spec` Web API route, use examples that apply to this country package. - -## 3.4.0 - -* Tax and benefit system evolution. -* Impacted periods: all. -* Impacted areas: `housing`. -* Details: - - Introduce `code_postal` variable. - -### 3.3.2 - -* Minor change. -* Details: - - Update entities labels. - -### 3.3.1 - [#53](https://github.com/openfisca/country-template/pull/53) - -* Minor change. -* Details: - - Add `documentation` to parameters: `benefits` node and `benefits/housing_allowance`. - - Add documentation to `housing_allowance` variable and formula. - -## 3.3.0 - [#51](https://github.com/openfisca/country-template/pull/51) - -* Technical change. - - Make package compatible with OpenFisca Core v24. - - Rename development dependencies from `test` to `dev`. - -### 3.2.3 - [#50](https://github.com/openfisca/country-template/pull/50) - -* Minor change. -* Details: - - Fix repository URL in package metadata. - -### 3.2.2 - [#49](https://github.com/openfisca/country-template/pull/49) - -* Tax and benefit system evolution. -* Impacted periods: all. -* Impacted areas: `taxes`. -* Details: - - Implement housing tax minimal amount. - - - -* Minor change. -* Details: - - Add metadata to parameters. - -### 3.2.1 - [#47](https://github.com/openfisca/country-template/pull/47) - -* Minor change. -* Details: - - Make boostrap script portable. - -## 3.2.0 - [#43](https://github.com/openfisca/country-template/pull/43) - -* Tax and benefit system evolution. -* Impacted periods: all. -* Impacted areas: `demographics`. -* Details: - - Improve reliability and accuracy of `age` formula. - - Improve variables comments. - -### 3.1.3 - [#37](https://github.com/openfisca/country-template/pull/37) - -* Minor change. -* Details: - - Upgrade openfisca.org references to HTTPS. - -### 3.1.2 - [#38](https://github.com/openfisca/country-template/pull/38) - -* Minor change. -* Details: - - Add situation example using YAML. - -### 3.1.1 - [#44](https://github.com/openfisca/country-template/pull/44) - -* Technical improvement. -* Details: - - Continuously deploy Python3 package. - -## 3.1.0 - [#41](https://github.com/openfisca/country-template/pull/41) - -* Technical improvement. -* Details: - - Make package compatible with Python 3. - -### 3.0.2 - [#37](https://github.com/openfisca/country-template/pull/37) - -* Technical change. -* Details: - - Declare package compatible with OpenFisca Core v23. - -### 3.0.1 - [#39](https://github.com/openfisca/country-template/pull/39) - -* Technical change. -* Details: - - Declare package compatible with OpenFisca Core v22. - -# 3.0.0 - [#34](https://github.com/openfisca/country-template/pull/34) - -#### Breaking change - -* Tax and benefit system evolution. -* Impacted periods: all. -* Impacted areas: `housing`. -* Details: - - Fix spelling by renaming `accomodation_size` variable to `accommodation_size`. - -#### Other changes - -* Minor change. -* Impacted areas: no functional impact. -* Details: - - Improve spelling. - -## 2.1.0 - [#29](https://github.com/openfisca/country-template/pull/29) [#30](https://github.com/openfisca/country-template/pull/30) - -* Tax and benefit system evolution. -* Impacted areas: - - Parameters `general`. - - Variables `benefits`. -* Details: - - Add a parameter and a variable with non ascii characters: - - Introduce `age_of_retirement` parameter. - - Introduce `pension` variable. - -### 2.0.1 - [#24](https://github.com/openfisca/country-template/pull/24) [#27](https://github.com/openfisca/country-template/pull/27) - -_Note: the 2.0.0 version has been unpublished due to performance issues._ - -#### Breaking change - -* Details: - - Upgrade to Core v21. - - Introduce the use of a string identifier to reference Enum items. - - When setting an Enum (e.g. housing_occupancy_status), set the relevant string identifier (e.g. `free_lodger`). Indexes (e.g.`2`) and phrases (e.g. `Free Lodgers`) cannot be used anymore. - - The default value is indicated for each Enum variable instead of being implicitly the first item of the enum. - -#### Web API request/response - -Before: - -``` -"persons": { - "Bill": {} -}, -"households": { - "_": { - "parent": ["Bill"] - "housing_occupancy_status": "Free Lodger" - } -} -``` - -Now: - -``` -"persons": { - "Bill": {} -}, -"households": { - "_": { - "parent": ["Bill"] - "housing_occupancy_status": "free_lodger" - } -} -``` - -#### YAML testing - -Before: - -``` -name: Household living in a 40 sq. metres accommodation while being free lodgers - period: 2017 - input_variables: - accommodation_size: - 2017-01: 40 - housing_occupancy_status: - 2017-01: 2 - output_variables: - housing_tax: 0 -``` - -Now: - -``` -name: Household living in a 40 sq. metres accommodation while being free lodgers - period: 2017 - input_variables: - accommodation_size: - 2017-01: 40 - housing_occupancy_status: - 2017-01: free_lodger - output_variables: - housing_tax: 0 -``` - -#### Python API - -When calculating an enum variable in Python, the output will be an [EnumArray](https://openfisca.org/doc/openfisca-python-api/enum_array.html). - -See more on the OpenFisca-Core [changelog](https://github.com/openfisca/openfisca-core/blob/enums-perfs/CHANGELOG.md#2102-589-600-605). - -## 1.4.0 - [#26](https://github.com/openfisca/country-template/pull/26) - -* Technical improvement. -* Details: - - Upgrade to Core v20. - -### 1.3.2 - [#25](https://github.com/openfisca/country-template/pull/25) - -* Technical improvement. -* Details: - - Declare package compatible with OpenFisca Core v19. - -### 1.3.1 - [#23](https://github.com/openfisca/country-template/pull/23) - -* Technical improvement. -* Details: - - Declare package compatible with OpenFisca Core v18. - -## 1.3.0 - [#22](https://github.com/openfisca/country-template/pull/22) - -* Tax and benefit system evolution. -* Impacted periods: all. -* Impacted areas: `stats`. -* Details: - - Introduce `total_benefits`. - - Introduce `total_taxes`. - - - -* Minor change. -* Details: - - Introduce situation examples: - - These examples can be imported with: `from openfisca_country_template.situation_examples import single, couple`. - -### 1.2.7 - [#21](https://github.com/openfisca/country-template/pull/21) - -* Minor change. -* Details: - - Use the technical documentation new address. - -### 1.2.6 - [#20](https://github.com/openfisca/country-template/pull/20) - -* Minor change. -* Details: - - Document entities. - -### 1.2.5 - [#17](https://github.com/openfisca/country-template/pull/17) - -* Technical improvement. -* Details: - - Adapt to version `17.0.0` of Openfisca-Core. - - Transform XML parameter files to YAML parameter files. - -### 1.2.4 - [#16](https://github.com/openfisca/country-template/pull/16) - -* Tax and benefit system evolution. -* Details: - - Introduce `housing_occupancy_status`. - - Take the housing occupancy status into account in the housing tax. - -### 1.2.3 - [#9](https://github.com/openfisca/country-template/pull/9) - -* Technical improvement -* Details: - - Adapt to version `15.0.0` of Openfisca-Core. - - Rename Variable attribute `url` to `reference`. - -### 1.2.2 - [#12](https://github.com/openfisca/country-template/pull/12) - -* Tax and benefit system evolution. -* Details: - - Allow to declare a yearly amount for `salary`. - - The yearly amount will be spread over the months contained in the year. - -### 1.2.1 - [#11](https://github.com/openfisca/country-template/pull/11) - -* Technical improvement. -* Details: - - Make `make test` command not ignore failing tests. - -## 1.2.0 - [#10](https://github.com/openfisca/country-template/pull/10) - -* Technical improvement. -* Details: - - Upgrade OpenFisca-Core: - - Update the way we define formulas start dates and variables stop dates. - - Update the naming conventions for variable formulas. - - See the [OpenFisca-Core Changelog](https://github.com/openfisca/openfisca-core/blob/master/CHANGELOG.md#1400---522). - -## 1.1.0 - [#7](https://github.com/openfisca/country-template/pull/7) - -* Tax and benefit system evolution. -* Impacted periods: from 2013-01-01. -* Impacted areas: - - Reform: `modify_social_security_taxation`. -* Details: - - Add a reform modifying the brackets of a scale: - - Show how to add, modify and remove a bracket. - - Add corresponding tests. - -# 1.0.0 - [#4](https://github.com/openfisca/country-template/pull/4) - -* Tax and benefit system evolution. -* Impacted periods: all. -* Impacted areas: - - `benefits`. - - `demographics`. - - `housing`. - - `income`. - - `taxes`. -* Details: - - Build the skeleton of the tax and benefit system. - -# Example Entry ## 0.0.1 - [#0](https://github.com/openfisca/country-template/pull/0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f8ff68..145c6a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ Examples: ### Changelog -openfisca-country_template changes must be understood by users who don't necessarily work on the code. The Changelog must therefore be as explicit as possible. +openfisca-france_firms changes must be understood by users who don't necessarily work on the code. The Changelog must therefore be as explicit as possible. Each change must be documented with the following elements: @@ -56,11 +56,11 @@ Each change must be documented with the following elements: > For instance : -> # 13.0.0 - [#671](https://example.com/repository/pull/671) +> # 13.0.0 - [#671](git://github.com/pzuldp/openfisca-france-firms.git/pull/671) > -> ## 13.2.0 - [#676](https://example.com/repository/pull/676) +> ## 13.2.0 - [#676](git://github.com/pzuldp/openfisca-france-firms.git/pull/676) > -> ### 13.1.5 - [#684](https://example.com/repository/pull/684) +> ### 13.1.5 - [#684](git://github.com/pzuldp/openfisca-france-firms.git/pull/684) - The second line indicates the type of the change. The possible types are: - `Tax and benefit system evolution`: Calculation improvement, fix, or update. Impacts the users interested in calculations. diff --git a/MANIFEST.in b/MANIFEST.in index 1e751a7..2464de5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -recursive-include openfisca_country_template * +recursive-include openfisca_france_firms * diff --git a/Makefile b/Makefile index 7f9f5a4..b580363 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ deps: install: deps @# Install OpenFisca-Extension-Template for development. - @# `make install` installs the editable version of openfisca-country_template. + @# `make install` installs the editable version of openfisca-france_firms. @# This allows contributors to test as they code. pip install --editable .[dev] --upgrade --use-deprecated=legacy-resolver @@ -41,7 +41,7 @@ check-style: yamllint `git ls-files | grep "\.yaml$$"` test: clean check-syntax-errors check-style - openfisca test --country-package openfisca_country_template openfisca_country_template/tests + openfisca test --country-package openfisca_france_firms openfisca_france_firms/tests serve-local: build - openfisca serve --country-package openfisca_country_template + openfisca serve --country-package openfisca_france_firms diff --git a/README.md b/README.md index bbc8983..7d65ed0 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,5 @@ -# OpenFisca Country-Template +# OpenFisca France Firms -This repository helps you quickly set up and use your own OpenFisca country package. - -**You should NOT fork it** but follow the set up instructions below. - -> Otherwise, you will have to clean up all tags when you deploy your own country package. - -## Setting up your Country Package - -This set of instructions **only needs to be followed once** and will create your own copy of this boilerplate directory, customising it to the country you want to work on. You will need to have [Git](https://git-scm.com) installed. - -### Using GitHub (recommended for GitHub users) - -1. Click on the [“Use this template” dropdown and select “Create a new repository”](https://github.com/new?template_name=country-template&template_owner=openfisca). - -2. Set the repository name to `openfisca-`; use underscore `_` as separator if there are spaces in the country name. For example, `openfisca-new_zealand` or `openfisca-france`. - -3. After being redirected to your newly created repository, please allow a few minutes for the automatic setup to be executed. Once done, the title of the README file should be updated to `OpenFisca `. - -> If the automatic setup does not start within a few minutes, you can initiate it manually: -> - Navigate to the “Actions” tab. -> - Select the “First time setup” workflow. -> - Click on “Run workflow” to start the setup process manually. - -4. Follow the instructions in the new repository's README.md. - -### Manual setup (recommended for users of other Git hosts) - -1. [Download a copy](https://github.com/openfisca/country-template/archive/master.zip) of this repository, unzip it and `cd` into it in a Terminal window. - -2. Create a new repository on your favourite git host (Bitbucket, GitLab, …) with the name `openfisca-`. For example, `openfisca-new_zealand` or `openfisca-france`. - -3. Execute the `first-time-setup.sh` script to initialise the git repository. This performs numerous tasks including replacing all references to `openfisca-country_template` with references to the new country package. - - To execute the script run `bash first-time-setup.sh` from the command line - - After the `first-time-setup.sh` has run both it and these instructions are removed. - -4. Follow the instructions in the new repository's `README.md.` - -## Writing the Legislation The country whose law is modelled here has a very simple tax and benefit system. @@ -45,14 +7,14 @@ The country whose law is modelled here has a very simple tax and benefit system. - On the first of December, 2015, it introduced a basic income for all its citizens of age who have no income. - On the first of December, 2016, it removed the income condition, providing all its adult citizens with a basic income. -These elements are described in different folders. All the modelling happens within the `openfisca_country_template` folder. +These elements are described in different folders. All the modelling happens within the `openfisca_france_firms` folder. - The rates are in the `parameters` folder. - The formulas are in the `variables` folder. - This country package comes also with *reforms* in the `reforms` folder. This is optional: your country may exist without defining any reform. - - In this country, there is [a reform project](./openfisca_country_template/reforms/modify_social_security_taxation.py) aiming to modify the social security taxation, deleting the first bracket, raising the intermediary ones and adding a new bracket with a higher tax rate of `40 %` for people earning more than `40000`. This reform project would apply starting from `2017-01-01`. + - In this country, there is [a reform project](./openfisca_france_firms/reforms/modify_social_security_taxation.py) aiming to modify the social security taxation, deleting the first bracket, raising the intermediary ones and adding a new bracket with a higher tax rate of `40 %` for people earning more than `40000`. This reform project would apply starting from `2017-01-01`. -The files that are outside from the `openfisca_country_template` folder are used to set up the development environment. +The files that are outside from the `openfisca_france_firms` folder are used to set up the development environment. ## Packaging your Country Package for Distribution @@ -131,7 +93,7 @@ pip --version # should print at least 9.0. Install the Country Package: ```sh -pip install openfisca-country_template +pip install openfisca-france_firms ``` :warning: Please beware that installing the Country Package with `pip` is dependent on its maintainers publishing said package. @@ -169,8 +131,8 @@ python --version # should print "Python 3.9.xx". Clone this Country Package on your machine: ```sh -git clone https://example.com/repository.git -cd repository_folder +git clone git://github.com/pzuldp/openfisca-france-firms.git.git +cd openfisca-france-firms.git pip install --upgrade pip build twine pip install --editable .[dev] --upgrade ``` @@ -193,7 +155,7 @@ If you are considering building a web application, you can use the packaged Open To serve the Openfisca Web API locally, run: ```sh -openfisca serve --port 5000 --country-package openfisca_country_template +openfisca serve --port 5000 --country-package openfisca_france_firms ``` Or use the quick-start Make command: @@ -218,6 +180,6 @@ You can test your new Web API by sending it example JSON data located in the `si ```sh curl -X POST -H "Content-Type: application/json" \ - -d @./openfisca_country_template/situation_examples/couple.json \ + -d @./openfisca_france_firms/situation_examples/couple.json \ http://localhost:5000/calculate ``` diff --git a/first-time-setup.sh b/first-time-setup.sh deleted file mode 100755 index a64b3b3..0000000 --- a/first-time-setup.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash - -set -e -GREEN='\033[0;32m' -PURPLE='\033[1;35m' -YELLOW='\033[0;33m' -BLUE='\033[1;34m' -JURISDICTION_NAME=${JURISDICTION_NAME:-$COUNTRY_NAME} # backwards compatibility - -# Support non-interactive setup through env variables -if [[ $JURISDICTION_NAME ]] && [[ $REPOSITORY_URL ]] -then continue=Y -fi - -if [[ ! $CI ]] && [[ -d .git ]] -then - echo 'It seems you cloned this repository, or already initialised it.' - echo 'Refusing to go further as you might lose work.' - echo "If you are certain this is a new repository, run 'cd $(dirname $0) && rm -rf .git' to erase the history." - exit 2 -fi - -while [[ ! "$JURISDICTION_NAME" ]] -do - echo -e "${GREEN}The name of the jurisdiction (usually a country, e.g. New Zealand, France…) you will model the rules of: \033[0m" - read JURISDICTION_NAME -done - -lowercase_jurisdiction_name=$(echo $JURISDICTION_NAME | tr '[:upper:]' '[:lower:]' | sed 'y/āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜĀÁǍÀĒÉĚÈĪÍǏÌŌÓǑÒŪÚǓÙǕǗǙǛ/aaaaeeeeiiiioooouuuuüüüüAAAAEEEEIIIIOOOOUUUUÜÜÜÜ/') -NO_SPACES_JURISDICTION_LABEL=$(echo $lowercase_jurisdiction_name | sed -r 's/[ ]+/_/g') # allow for hyphens to be used in jurisdiction names -SNAKE_CASE_JURISDICTION=$(echo $NO_SPACES_JURISDICTION_LABEL | sed -r 's/[-]+/_/g') # remove hyphens for use in Python - -while [[ ! "$REPOSITORY_URL" ]] -do - echo -e "${GREEN}Your Git repository URL: \033[0m (i.e. https://githost.example/organisation/openfisca-jurisdiction)" - read REPOSITORY_URL -done - -REPOSITORY_FOLDER=$(echo ${REPOSITORY_URL##*/}) - -cd $(dirname $0) # support being called from anywhere on the file system - -echo -e "${PURPLE}Jurisdiction title set to: \033[0m${BLUE}$JURISDICTION_NAME\033[0m" -# Removes hyphens for python environment -echo -e "${PURPLE}Jurisdiction Python label: \033[0m${BLUE}$SNAKE_CASE_JURISDICTION\033[0m" -echo -e "${PURPLE}Git repository URL : \033[0m${BLUE}$REPOSITORY_URL\033[0m" - -while [[ $continue != "y" ]] && [[ $continue != "Y" ]] -do - read -p "Would you like to continue (type Y for yes, N for no): " continue - if [[ $continue == "n" ]] || [[ $continue == "N" ]] - then exit 3 - fi -done - -parent_folder=${PWD##*/} -package_name="openfisca_$SNAKE_CASE_JURISDICTION" - -last_bootstrapping_line_number=$(grep --line-number '^## Writing the Legislation' README.md | cut -d ':' -f 1) -last_changelog_number=$(grep --line-number '^# Example Entry' CHANGELOG.md | cut -d ':' -f 1) - -first_commit_message='Initial import from OpenFisca country-template' -second_commit_message='Customise country-template through script' - -if [[ ! $CI ]] -then - echo - cd .. - mv $parent_folder openfisca-$NO_SPACES_JURISDICTION_LABEL - cd openfisca-$NO_SPACES_JURISDICTION_LABEL - - echo -e "${PURPLE}* ${PURPLE}Initialise git repository\033[0m" - git init --initial-branch=main > /dev/null 2>&1 - git add . - - git commit --no-gpg-sign --message "$first_commit_message" --author='OpenFisca Bot ' --quiet - echo -e "${PURPLE}* ${PURPLE}Initial git commit made to 'main' branch: '\033[0m${BLUE}$first_commit_message\033[0m${PURPLE}'\033[0m" -fi - -all_module_files=`find openfisca_country_template -type f ! -name "*.DS_Store"` -echo -e "${PURPLE}* ${PURPLE}Replace default country_template references\033[0m" -# Use intermediate backup files (`-i`) with a weird syntax due to lack of portable 'no backup' option. See https://stackoverflow.com/q/5694228/594053. -sed -i.template "s|openfisca-country_template|openfisca-$NO_SPACES_JURISDICTION_LABEL|g" README.md Makefile pyproject.toml CONTRIBUTING.md -sed -i.template "s|country_template|$SNAKE_CASE_JURISDICTION|g" README.md pyproject.toml .flake8 Makefile MANIFEST.in $all_module_files -sed -i.template "s|Country-Template|$JURISDICTION_NAME|g" README.md pyproject.toml .github/PULL_REQUEST_TEMPLATE.md CONTRIBUTING.md - -echo -e "${PURPLE}* ${PURPLE}Remove bootstrap instructions\033[0m" -sed -i.template -e "3,${last_bootstrapping_line_number}d" README.md # remove instructions lines - -echo -e "${PURPLE}* ${PURPLE}Prepare \033[0m${BLUE}README.MD\033[0m${PURPLE} and \033[0m${BLUE}CONTRIBUTING.md\033[0m" -sed -i.template "s|https://example.com/repository|$REPOSITORY_URL|g" README.md CONTRIBUTING.md - -echo -e "${PURPLE}* ${PURPLE}Prepare \033[0m${BLUE}CHANGELOG.md\033[0m" -sed -i.template -e "1,${last_changelog_number}d" CHANGELOG.md # remove country-template CHANGELOG leaving example - -echo -e "${PURPLE}* ${PURPLE}Prepare \033[0m${BLUE}pyproject.toml\033[0m" -sed -i.template "s|https://github.com/openfisca/country-template|$REPOSITORY_URL|g" pyproject.toml -sed -i.template 's|:: 5 - Production/Stable|:: 1 - Planning|g' pyproject.toml -sed -i.template 's|^version = "[0-9.]*"|version = "0.0.1"|g' pyproject.toml -sed -i.template "s|repository_folder|$REPOSITORY_FOLDER|g" README.md -find . -name "*.template" -type f -delete - -echo -e "${PURPLE}* ${PURPLE}Rename package to: \033[0m${BLUE}$package_name\033[0m" -git mv openfisca_country_template $package_name - -echo -e "${PURPLE}* ${PURPLE}Remove single use first time setup files\033[0m" -git rm .github/workflows/first-time-setup.yml > /dev/null 2>&1 -git rm first-time-setup.sh > /dev/null 2>&1 - -if [[ $CI ]] -then exit 0 # committing and tagging take directly place in the GitHub Actions workflow -fi - -git add . -git commit --no-gpg-sign --message "$second_commit_message" --author='OpenFisca Bot ' --quiet - -git tag "0.0.1" - -echo -e "${PURPLE}* ${PURPLE}Second commit and first tag made on 'main' branch: '\033[0m${BLUE}$second_commit_message\033[0m${PURPLE}'\033[0m" -echo - -echo -e "${YELLOW}* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \033[0m" -echo -e "${YELLOW}*\033[0m" -echo -e "${YELLOW}*\033[0m Bootstrap complete, you can now push this codebase to your remote repository.\033[0m" -echo -e "${YELLOW}*\033[0m First, set up the remote with '${BLUE}git remote add origin \033[0m'" # do not set this up automatically because we only know the HTTPS URL, which needs interactive authentication -echo -e "${YELLOW}*\033[0m You can then '${BLUE}git push origin main\033[0m'" -echo -e "${YELLOW}*\033[0m Then refer to the \033[0m${BLUE}README.md\033[0m" -echo -e "${YELLOW}*\033[0m The parent directory name has been changed, you can use ${BLUE}cd ../openfisca-${NO_SPACES_JURISDICTION_LABEL}\033[0m to navigate to it" -echo -e "${YELLOW}*\033[0m" -echo -e "${YELLOW}* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \033[0m" diff --git a/openfisca_country_template/__init__.py b/openfisca_france_firms/__init__.py similarity index 93% rename from openfisca_country_template/__init__.py rename to openfisca_france_firms/__init__.py index a1ca8a9..5404cc7 100644 --- a/openfisca_country_template/__init__.py +++ b/openfisca_france_firms/__init__.py @@ -12,8 +12,8 @@ from openfisca_core.taxbenefitsystems import TaxBenefitSystem -from openfisca_country_template import entities -from openfisca_country_template.situation_examples import couple +from openfisca_france_firms import entities +from openfisca_france_firms.situation_examples import couple COUNTRY_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/openfisca_country_template/entities.py b/openfisca_france_firms/entities.py similarity index 100% rename from openfisca_country_template/entities.py rename to openfisca_france_firms/entities.py diff --git a/openfisca_country_template/parameters/benefits/basic_income.yaml b/openfisca_france_firms/parameters/benefits/basic_income.yaml similarity index 100% rename from openfisca_country_template/parameters/benefits/basic_income.yaml rename to openfisca_france_firms/parameters/benefits/basic_income.yaml diff --git a/openfisca_country_template/parameters/benefits/housing_allowance.yaml b/openfisca_france_firms/parameters/benefits/housing_allowance.yaml similarity index 100% rename from openfisca_country_template/parameters/benefits/housing_allowance.yaml rename to openfisca_france_firms/parameters/benefits/housing_allowance.yaml diff --git a/openfisca_country_template/parameters/benefits/index.yaml b/openfisca_france_firms/parameters/benefits/index.yaml similarity index 100% rename from openfisca_country_template/parameters/benefits/index.yaml rename to openfisca_france_firms/parameters/benefits/index.yaml diff --git a/openfisca_country_template/parameters/benefits/parenting_allowance/amount.yaml b/openfisca_france_firms/parameters/benefits/parenting_allowance/amount.yaml similarity index 100% rename from openfisca_country_template/parameters/benefits/parenting_allowance/amount.yaml rename to openfisca_france_firms/parameters/benefits/parenting_allowance/amount.yaml diff --git a/openfisca_country_template/parameters/benefits/parenting_allowance/income_threshold.yaml b/openfisca_france_firms/parameters/benefits/parenting_allowance/income_threshold.yaml similarity index 100% rename from openfisca_country_template/parameters/benefits/parenting_allowance/income_threshold.yaml rename to openfisca_france_firms/parameters/benefits/parenting_allowance/income_threshold.yaml diff --git a/openfisca_country_template/parameters/general/age_of_majority.yaml b/openfisca_france_firms/parameters/general/age_of_majority.yaml similarity index 100% rename from openfisca_country_template/parameters/general/age_of_majority.yaml rename to openfisca_france_firms/parameters/general/age_of_majority.yaml diff --git a/openfisca_country_template/parameters/general/age_of_retirement.yaml b/openfisca_france_firms/parameters/general/age_of_retirement.yaml similarity index 100% rename from openfisca_country_template/parameters/general/age_of_retirement.yaml rename to openfisca_france_firms/parameters/general/age_of_retirement.yaml diff --git a/openfisca_country_template/parameters/taxes/housing_tax.yaml b/openfisca_france_firms/parameters/taxes/housing_tax.yaml similarity index 100% rename from openfisca_country_template/parameters/taxes/housing_tax.yaml rename to openfisca_france_firms/parameters/taxes/housing_tax.yaml diff --git a/openfisca_country_template/parameters/taxes/income_tax_rate.yaml b/openfisca_france_firms/parameters/taxes/income_tax_rate.yaml similarity index 100% rename from openfisca_country_template/parameters/taxes/income_tax_rate.yaml rename to openfisca_france_firms/parameters/taxes/income_tax_rate.yaml diff --git a/openfisca_country_template/parameters/taxes/social_security_contribution.yaml b/openfisca_france_firms/parameters/taxes/social_security_contribution.yaml similarity index 100% rename from openfisca_country_template/parameters/taxes/social_security_contribution.yaml rename to openfisca_france_firms/parameters/taxes/social_security_contribution.yaml diff --git a/openfisca_country_template/reforms/__init__.py b/openfisca_france_firms/reforms/__init__.py similarity index 100% rename from openfisca_country_template/reforms/__init__.py rename to openfisca_france_firms/reforms/__init__.py diff --git a/openfisca_country_template/reforms/add_dynamic_variable.py b/openfisca_france_firms/reforms/add_dynamic_variable.py similarity index 96% rename from openfisca_country_template/reforms/add_dynamic_variable.py rename to openfisca_france_firms/reforms/add_dynamic_variable.py index 8471866..521c7b4 100644 --- a/openfisca_country_template/reforms/add_dynamic_variable.py +++ b/openfisca_france_firms/reforms/add_dynamic_variable.py @@ -12,7 +12,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Person +from openfisca_france_firms.entities import Person def create_dynamic_variable(name, **variable): diff --git a/openfisca_country_template/reforms/add_new_tax.py b/openfisca_france_firms/reforms/add_new_tax.py similarity index 96% rename from openfisca_country_template/reforms/add_new_tax.py rename to openfisca_france_firms/reforms/add_new_tax.py index 710698c..1c77784 100644 --- a/openfisca_country_template/reforms/add_new_tax.py +++ b/openfisca_france_firms/reforms/add_new_tax.py @@ -12,7 +12,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Person +from openfisca_france_firms.entities import Person class has_car(Variable): diff --git a/openfisca_country_template/reforms/flat_social_security_contribution.py b/openfisca_france_firms/reforms/flat_social_security_contribution.py similarity index 100% rename from openfisca_country_template/reforms/flat_social_security_contribution.py rename to openfisca_france_firms/reforms/flat_social_security_contribution.py diff --git a/openfisca_country_template/reforms/modify_social_security_taxation.py b/openfisca_france_firms/reforms/modify_social_security_taxation.py similarity index 100% rename from openfisca_country_template/reforms/modify_social_security_taxation.py rename to openfisca_france_firms/reforms/modify_social_security_taxation.py diff --git a/openfisca_country_template/reforms/removal_basic_income.py b/openfisca_france_firms/reforms/removal_basic_income.py similarity index 100% rename from openfisca_country_template/reforms/removal_basic_income.py rename to openfisca_france_firms/reforms/removal_basic_income.py diff --git a/openfisca_country_template/situation_examples/__init__.py b/openfisca_france_firms/situation_examples/__init__.py similarity index 100% rename from openfisca_country_template/situation_examples/__init__.py rename to openfisca_france_firms/situation_examples/__init__.py diff --git a/openfisca_country_template/situation_examples/couple.json b/openfisca_france_firms/situation_examples/couple.json similarity index 100% rename from openfisca_country_template/situation_examples/couple.json rename to openfisca_france_firms/situation_examples/couple.json diff --git a/openfisca_country_template/situation_examples/housing.json b/openfisca_france_firms/situation_examples/housing.json similarity index 100% rename from openfisca_country_template/situation_examples/housing.json rename to openfisca_france_firms/situation_examples/housing.json diff --git a/openfisca_country_template/situation_examples/single.json b/openfisca_france_firms/situation_examples/single.json similarity index 100% rename from openfisca_country_template/situation_examples/single.json rename to openfisca_france_firms/situation_examples/single.json diff --git a/openfisca_country_template/tests/age.yaml b/openfisca_france_firms/tests/age.yaml similarity index 100% rename from openfisca_country_template/tests/age.yaml rename to openfisca_france_firms/tests/age.yaml diff --git a/openfisca_country_template/tests/basic_income.yaml b/openfisca_france_firms/tests/basic_income.yaml similarity index 100% rename from openfisca_country_template/tests/basic_income.yaml rename to openfisca_france_firms/tests/basic_income.yaml diff --git a/openfisca_country_template/tests/disposable_income.yaml b/openfisca_france_firms/tests/disposable_income.yaml similarity index 100% rename from openfisca_country_template/tests/disposable_income.yaml rename to openfisca_france_firms/tests/disposable_income.yaml diff --git a/openfisca_country_template/tests/housing_allowance.yaml b/openfisca_france_firms/tests/housing_allowance.yaml similarity index 100% rename from openfisca_country_template/tests/housing_allowance.yaml rename to openfisca_france_firms/tests/housing_allowance.yaml diff --git a/openfisca_country_template/tests/housing_tax.yaml b/openfisca_france_firms/tests/housing_tax.yaml similarity index 100% rename from openfisca_country_template/tests/housing_tax.yaml rename to openfisca_france_firms/tests/housing_tax.yaml diff --git a/openfisca_country_template/tests/income_tax.yaml b/openfisca_france_firms/tests/income_tax.yaml similarity index 100% rename from openfisca_country_template/tests/income_tax.yaml rename to openfisca_france_firms/tests/income_tax.yaml diff --git a/openfisca_country_template/tests/reforms/add_dynamic_variable.yaml b/openfisca_france_firms/tests/reforms/add_dynamic_variable.yaml similarity index 80% rename from openfisca_country_template/tests/reforms/add_dynamic_variable.yaml rename to openfisca_france_firms/tests/reforms/add_dynamic_variable.yaml index 25c75dd..849aef4 100644 --- a/openfisca_country_template/tests/reforms/add_dynamic_variable.yaml +++ b/openfisca_france_firms/tests/reforms/add_dynamic_variable.yaml @@ -6,7 +6,7 @@ # Note the `reforms: ` key in the below YAML blocks. - name: We will dynamically add a new variable "goes_to_school" thanks to a reform - reforms: openfisca_country_template.reforms.add_dynamic_variable.add_dynamic_variable + reforms: openfisca_france_firms.reforms.add_dynamic_variable.add_dynamic_variable period: 2017-01 output: goes_to_school: true diff --git a/openfisca_country_template/tests/reforms/add_new_tax.yaml b/openfisca_france_firms/tests/reforms/add_new_tax.yaml similarity index 79% rename from openfisca_country_template/tests/reforms/add_new_tax.yaml rename to openfisca_france_firms/tests/reforms/add_new_tax.yaml index 18ae17e..7547d5a 100644 --- a/openfisca_country_template/tests/reforms/add_new_tax.yaml +++ b/openfisca_france_firms/tests/reforms/add_new_tax.yaml @@ -6,7 +6,7 @@ # Note the `reforms: ` key in the below YAML blocks. - name: The new tax applies to car-holding people - reforms: openfisca_country_template.reforms.add_new_tax.add_new_tax + reforms: openfisca_france_firms.reforms.add_new_tax.add_new_tax period: 2017-01 input: salary: 2000 @@ -16,7 +16,7 @@ new_tax: 400 - name: The new tax does not apply otherwise - reforms: openfisca_country_template.reforms.add_new_tax.add_new_tax + reforms: openfisca_france_firms.reforms.add_new_tax.add_new_tax period: 2017-01 input: salary: 2000 diff --git a/openfisca_country_template/tests/reforms/modify_social_security_taxation.yaml b/openfisca_france_firms/tests/reforms/modify_social_security_taxation.yaml similarity index 71% rename from openfisca_country_template/tests/reforms/modify_social_security_taxation.yaml rename to openfisca_france_firms/tests/reforms/modify_social_security_taxation.yaml index ff7f2fd..f3627f2 100644 --- a/openfisca_country_template/tests/reforms/modify_social_security_taxation.yaml +++ b/openfisca_france_firms/tests/reforms/modify_social_security_taxation.yaml @@ -6,7 +6,7 @@ # Note the `reforms: ` key in the below YAML blocks. - name: No social security contribution on small salaries - reforms: openfisca_country_template.reforms.modify_social_security_taxation.modify_social_security_taxation + reforms: openfisca_france_firms.reforms.modify_social_security_taxation.modify_social_security_taxation period: 2017-01 input: salary: 2000 @@ -14,7 +14,7 @@ social_security_contribution: 0 - name: Increased social security contribution on medium salaries - reforms: openfisca_country_template.reforms.modify_social_security_taxation.modify_social_security_taxation + reforms: openfisca_france_firms.reforms.modify_social_security_taxation.modify_social_security_taxation period: 2017-01 input: salary: 15000 @@ -22,7 +22,7 @@ social_security_contribution: 1336 - name: High social security contribution on high salaries - reforms: openfisca_country_template.reforms.modify_social_security_taxation.modify_social_security_taxation + reforms: openfisca_france_firms.reforms.modify_social_security_taxation.modify_social_security_taxation period: 2017-01 input: salary: 50000 diff --git a/openfisca_country_template/tests/situations/income_tax.yaml b/openfisca_france_firms/tests/situations/income_tax.yaml similarity index 100% rename from openfisca_country_template/tests/situations/income_tax.yaml rename to openfisca_france_firms/tests/situations/income_tax.yaml diff --git a/openfisca_country_template/tests/situations/parenting_allowance.yaml b/openfisca_france_firms/tests/situations/parenting_allowance.yaml similarity index 100% rename from openfisca_country_template/tests/situations/parenting_allowance.yaml rename to openfisca_france_firms/tests/situations/parenting_allowance.yaml diff --git a/openfisca_country_template/tests/social_security_contribution.yaml b/openfisca_france_firms/tests/social_security_contribution.yaml similarity index 100% rename from openfisca_country_template/tests/social_security_contribution.yaml rename to openfisca_france_firms/tests/social_security_contribution.yaml diff --git a/openfisca_country_template/variables/__init__.py b/openfisca_france_firms/variables/__init__.py similarity index 100% rename from openfisca_country_template/variables/__init__.py rename to openfisca_france_firms/variables/__init__.py diff --git a/openfisca_country_template/variables/benefits.py b/openfisca_france_firms/variables/benefits.py similarity index 98% rename from openfisca_country_template/variables/benefits.py rename to openfisca_france_firms/variables/benefits.py index 3703113..8880031 100644 --- a/openfisca_country_template/variables/benefits.py +++ b/openfisca_france_firms/variables/benefits.py @@ -11,7 +11,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Household, Person +from openfisca_france_firms.entities import Household, Person class basic_income(Variable): diff --git a/openfisca_country_template/variables/demographics.py b/openfisca_france_firms/variables/demographics.py similarity index 97% rename from openfisca_country_template/variables/demographics.py rename to openfisca_france_firms/variables/demographics.py index e2872a9..388db78 100644 --- a/openfisca_country_template/variables/demographics.py +++ b/openfisca_france_firms/variables/demographics.py @@ -16,7 +16,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Person +from openfisca_france_firms.entities import Person # This variable is a pure input: it doesn't have a formula diff --git a/openfisca_country_template/variables/housing.py b/openfisca_france_firms/variables/housing.py similarity index 96% rename from openfisca_country_template/variables/housing.py rename to openfisca_france_firms/variables/housing.py index 780720e..11f9d7d 100644 --- a/openfisca_country_template/variables/housing.py +++ b/openfisca_france_firms/variables/housing.py @@ -12,7 +12,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Household +from openfisca_france_firms.entities import Household # This variable is a pure input: it doesn't have a formula diff --git a/openfisca_country_template/variables/income.py b/openfisca_france_firms/variables/income.py similarity index 96% rename from openfisca_country_template/variables/income.py rename to openfisca_france_firms/variables/income.py index 1b48144..62ee80f 100644 --- a/openfisca_country_template/variables/income.py +++ b/openfisca_france_firms/variables/income.py @@ -12,7 +12,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Person +from openfisca_france_firms.entities import Person # This variable is a pure input: it doesn't have a formula diff --git a/openfisca_country_template/variables/stats.py b/openfisca_france_firms/variables/stats.py similarity index 96% rename from openfisca_country_template/variables/stats.py rename to openfisca_france_firms/variables/stats.py index d2fa6f4..b052a45 100644 --- a/openfisca_country_template/variables/stats.py +++ b/openfisca_france_firms/variables/stats.py @@ -11,7 +11,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Household +from openfisca_france_firms.entities import Household class total_benefits(Variable): diff --git a/openfisca_country_template/variables/taxes.py b/openfisca_france_firms/variables/taxes.py similarity index 98% rename from openfisca_country_template/variables/taxes.py rename to openfisca_france_firms/variables/taxes.py index 5e93700..d2b8c84 100644 --- a/openfisca_country_template/variables/taxes.py +++ b/openfisca_france_firms/variables/taxes.py @@ -14,7 +14,7 @@ from openfisca_core.variables import Variable # Import the Entities specifically defined for this tax and benefit system -from openfisca_country_template.entities import Household, Person +from openfisca_france_firms.entities import Household, Person class income_tax(Variable): diff --git a/pyproject.toml b/pyproject.toml index 070531c..bfc1540 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ [project] -name = "openfisca-country_template" -version = "7.1.3" -description = "OpenFisca Rules as Code model for Country-Template." +name = "openfisca-france_firms" +version = "0.0.1" +description = "OpenFisca Rules as Code model for France Firms." readme = "README.md" keywords = ["microsimulation", "tax", "benefit", "rac", "rules-as-code"] authors = [] maintainers = [] classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 1 - Planning", "License :: OSI Approved :: GNU Affero General Public License v3", "Operating System :: POSIX", "Programming Language :: Python", @@ -22,11 +22,11 @@ dependencies = [ ] [project.urls] -Homepage = "https://github.com/openfisca/country-template" -Repository = "https://github.com/openfisca/country-template" +Homepage = "git://github.com/pzuldp/openfisca-france-firms.git" +Repository = "git://github.com/pzuldp/openfisca-france-firms.git" Documentation = "https://openfisca.org/doc" -Issues = "https://github.com/openfisca/country-template/issues" -Changelog = "https://github.com/openfisca/country-template/blob/main/CHANGELOG.md" +Issues = "git://github.com/pzuldp/openfisca-france-firms.git/issues" +Changelog = "git://github.com/pzuldp/openfisca-france-firms.git/blob/main/CHANGELOG.md" [project.optional-dependencies] dev = [ @@ -40,7 +40,7 @@ dev = [ [tool.pytest.ini_options] addopts = "--showlocals --doctest-modules" -testpaths = [ "openfisca_country_template/tests" ] +testpaths = [ "openfisca_france_firms/tests" ] python_files = "**/*.py" filterwarnings = [ "error", @@ -73,10 +73,10 @@ group_by_package = "true" include_trailing_comma = "true" multi_line_output = "8" py_version = "39" -known_first_party = "openfisca_country_template" +known_first_party = "openfisca_france_firms" known_openfisca = [ "openfisca_core", - "openfisca_country_template" + "openfisca_france_firms" ] known_typing = [ "mypy*",