Pin dependencies to ensure that pip will use the exact version of deps

This is a backport / adaptation of 5d3266873e (#558), accounting for the
fact that we are not using setup.cfg.
This commit is contained in:
Baptiste Jonglez 2020-05-01 00:19:48 +02:00 committed by zorun
parent 486c584746
commit e37d0a98ff
7 changed files with 31 additions and 70 deletions

View file

@ -1,3 +1,3 @@
include *.rst
recursive-include ihatemoney *.rst *.py *.yaml *.po *.mo *.html *.css *.js *.eot *.svg *.woff *.txt *.png *.ini *.cfg *.j2
include LICENSE CONTRIBUTORS CHANGELOG.rst requirements.txt
include LICENSE CONTRIBUTORS CHANGELOG.rst

View file

@ -14,7 +14,7 @@ all: install ## Alias for install
install: virtualenv $(INSTALL_STAMP) ## Install dependencies
$(INSTALL_STAMP):
$(VENV)/bin/pip install -U pip
$(VENV)/bin/pip install -r requirements.txt
$(VENV)/bin/pip install -e .
touch $(INSTALL_STAMP)
.PHONY: virtualenv
@ -24,8 +24,8 @@ $(PYTHON):
.PHONY: install-dev
install-dev: $(INSTALL_STAMP) $(DEV_STAMP) ## Install development dependencies
$(DEV_STAMP): $(PYTHON) dev-requirements.txt
$(VENV)/bin/pip install -Ur dev-requirements.txt
$(DEV_STAMP): $(PYTHON)
$(VENV)/bin/pip install -Ue .[dev]
touch $(DEV_STAMP)
.PHONY: remove-install-stamp
@ -76,13 +76,6 @@ create-empty-database-revision: ## Create an empty database revision
@read -p "Please enter a message describing this revision: " rev_message; \
$(PYTHON) -m ihatemoney.manage db revision -d ihatemoney/migrations -m "$${rev_message}"
.PHONY: build-requirements
build-requirements: ## Save currently installed packages to requirements.txt
$(VIRTUALENV) $(TEMPDIR)
$(TEMPDIR)/bin/pip install -U pip
$(TEMPDIR)/bin/pip install -Ue "."
$(TEMPDIR)/bin/pip freeze | grep -v -- '-e' > requirements.txt
.PHONY: clean
clean: ## Destroy the virtual environment
rm -rf .venv

View file

@ -1,6 +0,0 @@
zest.releaser
tox
pytest
flake8
Flask-Testing
mock; python_version < '3.3'

View file

@ -23,10 +23,9 @@ install dependencies, and run the test server.
The hard way
------------
Alternatively, you can also use the `requirements.txt` file to install the
dependencies yourself. That would be::
Alternatively, you can use pip to install dependencies yourself. That would be::
pip install -r requirements.txt
pip install -e .
And then run the application::
@ -156,11 +155,7 @@ In order to prepare a new release, we are following the following steps:
- Merge remaining pull requests;
- Update :file:`CHANGELOG.rst` with the last changes;
- Update :file:`CONTRIBUTORS`;
- Update known good versions of dependencies in ``requirements.txt`` with this
command (from inside the venv)::
make build-requirements
- Update known good versions of dependencies in ``setup.py``;
- If needed, recompress assets. It requires zopflipng::
make compress-assets

View file

@ -1,27 +0,0 @@
alembic==1.1.0
aniso8601==8.0.0
Babel==2.7.0
blinker==1.4
Click==7.0
dnspython==1.16.0
email-validator==1.0.4
Flask==1.1.1
Flask-Babel==0.12.2
Flask-Cors==3.0.8
Flask-Mail==0.9.1
Flask-Migrate==2.5.2
Flask-RESTful==0.3.7
Flask-Script==2.0.6
Flask-SQLAlchemy==2.4.0
Flask-WTF==0.14.2
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10.1
Mako==1.1.0
MarkupSafe==1.1.1
python-dateutil==2.8.0
pytz==2019.2
six==1.12.0
SQLAlchemy==1.3.8
Werkzeug==0.15.6
WTForms==2.2.1

View file

@ -56,18 +56,27 @@ setup(name='ihatemoney',
include_package_data=True,
zip_safe=False,
install_requires=[
"flask",
"flask-wtf",
"flask-sqlalchemy<3.0",
"flask-mail",
"Flask-Migrate",
"Flask-script",
"flask-babel",
"flask-restful",
"jinja2",
"blinker",
"flask-cors",
"six",
"itsdangerous",
"email_validator"],
"blinker==1.4",
"email-validator==1.0.4",
"Flask==1.1.1",
"Flask-Babel==0.12.2",
"Flask-Cors==3.0.8",
"Flask-Mail==0.9.1",
"Flask-Migrate==2.5.2",
"Flask-RESTful==0.3.7",
"Flask-Script==2.0.6",
"Flask-SQLAlchemy==2.4.0",
"Flask-WTF==0.14.2",
"itsdangerous==1.1.0",
"Jinja2==2.10.1",
"six==1.12.0",
],
extras_require={"dev": [
"zest.releaser",
"tox",
"pytest",
"flake8",
"Flask-Testing",
"mock; python_version < '3.3'"
]},
entry_points=ENTRY_POINTS)

View file

@ -9,8 +9,7 @@ commands =
py.test --pyargs ihatemoney.tests.tests
deps =
-rdev-requirements.txt
-rrequirements.txt
-e.[dev]
# To be sure we are importing ihatemoney pkg from pip-installed version
changedir = /tmp
@ -23,8 +22,6 @@ changedir = {toxinidir}
[testenv:lint]
commands = flake8 ihatemoney
deps =
-rdev-requirements.txt
changedir = {toxinidir}
[flake8]