diff mbox series

[08/11] requirements: Start using fixed versions

Message ID 20180624195557.19909-8-stephen@that.guru
State Changes Requested
Headers show
Series [01/11] REST: Check.user is not read-only | expand

Commit Message

Stephen Finucane June 24, 2018, 7:55 p.m. UTC
Given that 'tox' doesn't actually read any of these, there's no reason
to use ranges of requirements. Instead, use the latest and greatest for
live instances and rely on tox to validate behavior with older versions.

Signed-off-by: Stephen Finucane <stephen@that.guru>
---
 requirements-dev.txt  |  5 +----
 requirements-prod.txt | 10 +++++-----
 requirements-test.txt |  6 ++----
 3 files changed, 8 insertions(+), 13 deletions(-)

Comments

Daniel Axtens Aug. 10, 2018, 6:08 p.m. UTC | #1
Stephen Finucane <stephen@that.guru> writes:

> Given that 'tox' doesn't actually read any of these, there's no reason
> to use ranges of requirements. Instead, use the latest and greatest for
> live instances and rely on tox to validate behavior with older versions.
>

I don't know if it's this patch or one of the other patches that change
things in tox, but this breaks my postgres workflow:

docker-compose -f docker-compose-pg.yml up -d
docker-compose -f docker-compose-pg.yml run web --quick-tox
...
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
...

I think the psycopg2 stuff needs to be in requirements-test.txt instead
of just requirements-prod.txt?

Regards,
Daniel

> Signed-off-by: Stephen Finucane <stephen@that.guru>
> ---
>  requirements-dev.txt  |  5 +----
>  requirements-prod.txt | 10 +++++-----
>  requirements-test.txt |  6 ++----
>  3 files changed, 8 insertions(+), 13 deletions(-)
>
> diff --git a/requirements-dev.txt b/requirements-dev.txt
> index f4ad751a..47465a3e 100644
> --- a/requirements-dev.txt
> +++ b/requirements-dev.txt
> @@ -1,5 +1,2 @@
> -Django>=1.11,<2.1; python_version >= '3.4'
> -Django>=1.11,<2.0; python_version < '3.0'
> -djangorestframework>=3.4,<3.9
> -django-filter>=1.0,<1.2
> +-r requirements-prod.txt
>  -r requirements-test.txt
> diff --git a/requirements-prod.txt b/requirements-prod.txt
> index e7a75354..1e075629 100644
> --- a/requirements-prod.txt
> +++ b/requirements-prod.txt
> @@ -1,6 +1,6 @@
> -Django>=1.11,<2.1; python_version >= '3.4'
> -Django>=1.11,<2.0; python_version < '3.0'
> -djangorestframework>=3.4,<3.9
> -django-filter>=1.0,<1.2
> -psycopg2>=2.7,<2.8
> +Django==2.0.6; python_version >= '3.4'
> +Django==1.11.13; python_version < '3.0'
> +djangorestframework==3.8.2
> +django-filter==1.1.0
> +psycopg2-binary==2.7.5
>  sqlparse==0.2.4
> diff --git a/requirements-test.txt b/requirements-test.txt
> index 94dc3db7..759db77b 100644
> --- a/requirements-test.txt
> +++ b/requirements-test.txt
> @@ -1,5 +1,3 @@
> -mysqlclient>=1.3,<1.4
> -psycopg2-binary>=2.7,<2.8
> +mysqlclient==1.3.12
>  django-debug-toolbar==1.9.1
> -python-dateutil>2.0,<3.0
> -selenium>=3.0,<4.0
> +python-dateutil==2.7.3
> -- 
> 2.17.1
>
> _______________________________________________
> Patchwork mailing list
> Patchwork@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork
Stephen Finucane Aug. 29, 2018, 10:03 a.m. UTC | #2
On Sat, 2018-08-11 at 04:08 +1000, Daniel Axtens wrote:
> Stephen Finucane <stephen@that.guru> writes:
> 
> > Given that 'tox' doesn't actually read any of these, there's no reason
> > to use ranges of requirements. Instead, use the latest and greatest for
> > live instances and rely on tox to validate behavior with older versions.
> > 
> 
> I don't know if it's this patch or one of the other patches that change
> things in tox, but this breaks my postgres workflow:
> 
> docker-compose -f docker-compose-pg.yml up -d
> docker-compose -f docker-compose-pg.yml run web --quick-tox
> ...
> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'
> ...
> 
> I think the psycopg2 stuff needs to be in requirements-test.txt instead
> of just requirements-prod.txt?

Yeah, I couldn't do this as there would be a conflict between the
versions in requirements-dev.txt, due to it including both
requirements-prod.txt and requirements-test.txt. I've fixed this (I
think) by removing the import of requirements-prod.txt from
requirements-dev.txt once again.

Stephen

> Regards,
> Daniel
> 
> > Signed-off-by: Stephen Finucane <stephen@that.guru>
> > ---
> >  requirements-dev.txt  |  5 +----
> >  requirements-prod.txt | 10 +++++-----
> >  requirements-test.txt |  6 ++----
> >  3 files changed, 8 insertions(+), 13 deletions(-)
> > 
> > diff --git a/requirements-dev.txt b/requirements-dev.txt
> > index f4ad751a..47465a3e 100644
> > --- a/requirements-dev.txt
> > +++ b/requirements-dev.txt
> > @@ -1,5 +1,2 @@
> > -Django>=1.11,<2.1; python_version >= '3.4'
> > -Django>=1.11,<2.0; python_version < '3.0'
> > -djangorestframework>=3.4,<3.9
> > -django-filter>=1.0,<1.2
> > +-r requirements-prod.txt
> >  -r requirements-test.txt
> > diff --git a/requirements-prod.txt b/requirements-prod.txt
> > index e7a75354..1e075629 100644
> > --- a/requirements-prod.txt
> > +++ b/requirements-prod.txt
> > @@ -1,6 +1,6 @@
> > -Django>=1.11,<2.1; python_version >= '3.4'
> > -Django>=1.11,<2.0; python_version < '3.0'
> > -djangorestframework>=3.4,<3.9
> > -django-filter>=1.0,<1.2
> > -psycopg2>=2.7,<2.8
> > +Django==2.0.6; python_version >= '3.4'
> > +Django==1.11.13; python_version < '3.0'
> > +djangorestframework==3.8.2
> > +django-filter==1.1.0
> > +psycopg2-binary==2.7.5
> >  sqlparse==0.2.4
> > diff --git a/requirements-test.txt b/requirements-test.txt
> > index 94dc3db7..759db77b 100644
> > --- a/requirements-test.txt
> > +++ b/requirements-test.txt
> > @@ -1,5 +1,3 @@
> > -mysqlclient>=1.3,<1.4
> > -psycopg2-binary>=2.7,<2.8
> > +mysqlclient==1.3.12
> >  django-debug-toolbar==1.9.1
> > -python-dateutil>2.0,<3.0
> > -selenium>=3.0,<4.0
> > +python-dateutil==2.7.3
> > -- 
> > 2.17.1
> > 
> > _______________________________________________
> > Patchwork mailing list
> > Patchwork@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/patchwork
diff mbox series

Patch

diff --git a/requirements-dev.txt b/requirements-dev.txt
index f4ad751a..47465a3e 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,5 +1,2 @@ 
-Django>=1.11,<2.1; python_version >= '3.4'
-Django>=1.11,<2.0; python_version < '3.0'
-djangorestframework>=3.4,<3.9
-django-filter>=1.0,<1.2
+-r requirements-prod.txt
 -r requirements-test.txt
diff --git a/requirements-prod.txt b/requirements-prod.txt
index e7a75354..1e075629 100644
--- a/requirements-prod.txt
+++ b/requirements-prod.txt
@@ -1,6 +1,6 @@ 
-Django>=1.11,<2.1; python_version >= '3.4'
-Django>=1.11,<2.0; python_version < '3.0'
-djangorestframework>=3.4,<3.9
-django-filter>=1.0,<1.2
-psycopg2>=2.7,<2.8
+Django==2.0.6; python_version >= '3.4'
+Django==1.11.13; python_version < '3.0'
+djangorestframework==3.8.2
+django-filter==1.1.0
+psycopg2-binary==2.7.5
 sqlparse==0.2.4
diff --git a/requirements-test.txt b/requirements-test.txt
index 94dc3db7..759db77b 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,5 +1,3 @@ 
-mysqlclient>=1.3,<1.4
-psycopg2-binary>=2.7,<2.8
+mysqlclient==1.3.12
 django-debug-toolbar==1.9.1
-python-dateutil>2.0,<3.0
-selenium>=3.0,<4.0
+python-dateutil==2.7.3