Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove constraint on packages #1160

Merged
merged 6 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
build-${{ env.pythonLocation }}-

- name: Build package
run: make build
run: make install-deps install-test build

- name: Cache release
id: restore-release
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*~
.coverage
.mypy_cache
.mypy_cache*
.noseids
.project
.pydevproject
Expand All @@ -13,7 +14,6 @@
.tags*
.venv
.vscode
.vscode
build
cover
dist
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 35.12.0 [#1160](https://github.com/openfisca/openfisca-core/pull/1160)

#### New Features

- Lighter install by removing test packages from systematic install.

### 35.11.2 [#1166](https://github.com/openfisca/openfisca-core/pull/1166)

#### Technical changes
Expand Down Expand Up @@ -39,7 +45,7 @@

#### New Features

- Introduce a maximal depth for compuation logs
- Introduce a maximal depth for computation logs
- Allows for limiting the depth of the computation log chain

### 35.8.6 [#1145](https://github.com/openfisca/openfisca-core/pull/1145)
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ git clone https://github.com/openfisca/openfisca-core.git
cd openfisca-core
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install --editable .[dev] --use-deprecated=legacy-resolver
make install-deps install-edit
```

### Installing `openfisca-core` with `conda`
Expand Down Expand Up @@ -69,6 +68,18 @@ For information on how we publish to conda-forge, see [openfisca-core-feedstock]

## Testing

Install the test dependencies:

```
make install-deps install-edit install-test
```

> For integration testing purposes, `openfisca-core` relies on
> [country-template](https://github.com/openfisca/country-template.git) and
> [extension-template](https://github.com/openfisca/extension-template.git).
> Because these packages rely at the same time on `openfisca-core`, they need
> to be installed separately.

To run the entire test suite:

```sh
Expand Down
16 changes: 10 additions & 6 deletions openfisca_tasks/install.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
## Install project dependencies.
install:
## Uninstall project's dependencies.
uninstall:
@$(call print_help,$@:)
@pip freeze | grep -v "^-e" | sed "s/@.*//" | xargs pip uninstall -y

## Install project's overall dependencies
install-deps:
@$(call print_help,$@:)
@pip install --upgrade pip twine wheel
@pip install --editable ".[dev]" --upgrade

## Uninstall project dependencies.
uninstall:
## Install project's development dependencies.
install-edit:
@$(call print_help,$@:)
@pip freeze | grep -v "^-e" | sed "s/@.*//" | xargs pip uninstall -y
@pip install --upgrade --editable ".[dev]"

## Delete builds and compiled python files.
clean:
Expand Down
4 changes: 2 additions & 2 deletions openfisca_tasks/publish.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.PHONY: build

## Install openfisca-core for deployment and publishing.
## Build & install openfisca-core for deployment and publishing.
build:
@## This allows us to be sure tests are run against the packaged version
@## of openfisca-core, the same we put in the hands of users and reusers.
@$(call print_help,$@:)
@pip install --upgrade pip build twine
bonjourmauko marked this conversation as resolved.
Show resolved Hide resolved
@pip install --upgrade build
@python -m build
@pip uninstall --yes openfisca-core
@find dist -name "*.whl" -exec pip install {}[dev] \;
Expand Down
9 changes: 9 additions & 0 deletions openfisca_tasks/test_code.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ openfisca = openfisca_core.scripts.openfisca_command
## The path to the installed packages.
python_packages = $(shell python -c "import sysconfig; print(sysconfig.get_paths()[\"purelib\"])")

## Run all tasks required for testing.
install: install-deps install-edit install-test

## Enable regression testing with template repositories.
install-test:
@$(call print_help,$@:)
@pip install --upgrade --no-dependencies openfisca-country-template
@pip install --upgrade --no-dependencies openfisca-extension-template

## Run openfisca-core & country/extension template tests.
test-code: test-core test-country test-extension
@## Usage:
Expand Down
21 changes: 17 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#! /usr/bin/env python
"""Package config file.

This file contains all package's metadata, including the current version and
its third-party dependencies.

Note:
For integration testing, OpenFisca-Core relies on two other packages,
listed below. Because these packages rely at the same time on
OpenFisca-Core, adding them as official dependencies creates a resolution
loop that makes it hard to contribute. We've therefore decided to install
them via the task manager (`make install-test`)::

openfisca-country-template = "*"
openfisca-extension-template = "*"

"""

from setuptools import setup, find_packages
from pathlib import Path
Expand Down Expand Up @@ -40,16 +55,14 @@
'flake8-print >= 3.1.0, < 4.0.0',
'flake8-rst-docstrings == 0.2.3',
'mypy == 0.910',
'openfisca-country-template >= 3.10.0, < 4.0.0',
'openfisca-extension-template >= 1.2.0rc0, < 2.0.0',
bonjourmauko marked this conversation as resolved.
Show resolved Hide resolved
'pycodestyle >= 2.8.0, < 2.9.0',
'pylint == 2.10.2',
'xdoctest >= 1.0.0, < 2.0.0',
] + api_requirements

setup(
name = 'OpenFisca-Core',
version = '35.11.2',
version = '35.12.0',
author = 'OpenFisca Team',
author_email = 'contact@openfisca.org',
classifiers = [
Expand Down