django-configurations icon indicating copy to clipboard operation
django-configurations copied to clipboard

Migrate to django-environ

Open tkdchen opened this issue 4 years ago • 10 comments

This patch uses django-environ and drop deprecated and old packages django-cache-url, dj-email-url, dj-database-url and dj-cache-url.

Tests are updated according to the behavior of django-environ.

Signed-off-by: Chenxiong Qi [email protected]

tkdchen avatar Oct 06 '19 14:10 tkdchen

Codecov Report

Merging #244 (f376341) into master (089a039) will decrease coverage by 0.32%. The diff coverage is 100.00%.

:exclamation: Current head f376341 differs from pull request most recent head fb7417f. Consider uploading reports for the commit fb7417f to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
- Coverage   90.08%   89.75%   -0.33%     
==========================================
  Files          27       25       -2     
  Lines        1210     1201       -9     
  Branches      101      107       +6     
==========================================
- Hits         1090     1078      -12     
- Misses         89       90       +1     
- Partials       31       33       +2     
Flag Coverage Δ
coverage 89.67% <100.00%> (?)
dj111 89.67% <100.00%> (?)
dj20 88.59% <100.00%> (?)
dj21 88.42% <100.00%> (?)
py27 89.09% <100.00%> (?)
py34 88.59% <100.00%> (?)
py35 88.59% <100.00%> (?)
py36 88.59% <100.00%> (?)
py37 88.59% <100.00%> (?)
pypy 89.09% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
configurations/values.py 95.22% <100.00%> (+0.90%) :arrow_up:
tests/test_values.py 100.00% <100.00%> (ø)
tests/settings/main.py 88.23% <0.00%> (-1.51%) :arrow_down:
configurations/base.py 82.45% <0.00%> (-0.88%) :arrow_down:
tests/test_main.py 95.23% <0.00%> (-0.51%) :arrow_down:
tests/urls.py 100.00% <0.00%> (ø)
tests/test_env.py 100.00% <0.00%> (ø)
tests/docs/conf.py 100.00% <0.00%> (ø)
tests/setup_test.py 100.00% <0.00%> (ø)
tests/test_sphinx.py 100.00% <0.00%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 089a039...fb7417f. Read the comment docs.

codecov[bot] avatar Oct 06 '19 14:10 codecov[bot]

I think django-environ is a strong addiction. I would prefer to leave django-configuration as light as possible.

pauloxnet avatar Nov 06 '19 14:11 pauloxnet

Hi team / @tkdchen any update on this? It looks like all code review has been addressed. Would be great to get this merged!

@pauloxnet What's your reasoning for having django-configurations "as light as possible"? I think this is a positive change because:

  • it unifies more of the Python ecosystem on to django-environ as the parser for configuration URLs
  • this means more consistency and interoperability with other packages or in other environments
  • it removes 4 dependencies that need to be managed/bumped/etc, so in a way is "lighter"

danpalmer avatar Jun 24 '20 09:06 danpalmer

Hi folks.

Can you see also https://github.com/django/django/pull/13029 and the related mailing list discussion?

tl;dr: Maybe we pull something into Django here. Perhaps it makes sense to have env vars read by the default project templates, but we should get right exactly what that should look like, and I don't want us to reinvent something that's already solved™ by the community.

It would be good to get your thoughts as contributors here.

Thanks 😉 C.

carltongibson avatar Jun 24 '20 10:06 carltongibson

@auvipy It looks like @pauloxnet (who is now helping to maintain this project) objects to this change:

I think django-environ is a strong addiction. I would prefer to leave django-configuration as light as possible.

Could we get a consensus before merging this? If you (@auvipy) are planning to merge things yourself, could you please join the maintainer team and communicate your intentions with the rest of us: https://github.com/jazzband/django-configurations/issues/295#issuecomment-952496038


@pauloxnet Do you still object to this? It looks like django-environ is actively being maintained, whereas it looks like at least dj-database-url is unmaintained and in some sort of strange fork state. In particular, can you respond to @danpalmer's comment:

@pauloxnet What's your reasoning for having django-configurations "as light as possible"? I think this is a positive change because:

  • it unifies more of the Python ecosystem on to django-environ as the parser for configuration URLs
  • this means more consistency and interoperability with other packages or in other environments
  • it removes 4 dependencies that need to be managed/bumped/etc, so in a way is "lighter"

brianhelba avatar Oct 27 '21 04:10 brianhelba

@pauloxnet Do you still object to this? It looks like django-environ is actively being maintained, whereas it looks like at least dj-database-url is unmaintained and in some sort of strange fork state. In particular, can you respond to @danpalmer's comment

I'm going to review again this PR but the main guidelines for me is similar to the one used by Django to strongly avoid to depend on other packages, or depend only on trusted, maintained and really necessary ones.

pauloxnet avatar Oct 27 '21 08:10 pauloxnet

@auvipy It looks like @pauloxnet (who is now helping to maintain this project) objects to this change:

I think django-environ is a strong addiction. I would prefer to leave django-configuration as light as possible.

Could we get a consensus before merging this? If you (@auvipy) are planning to merge things yourself, could you please join the maintainer team and communicate your intentions with the rest of us: #295 (comment)

@pauloxnet Do you still object to this? It looks like django-environ is actively being maintained, whereas it looks like at least dj-database-url is unmaintained and in some sort of strange fork state. In particular, can you respond to @danpalmer's comment:

@pauloxnet What's your reasoning for having django-configurations "as light as possible"? I think this is a positive change because:

  • it unifies more of the Python ecosystem on to django-environ as the parser for configuration URLs
  • this means more consistency and interoperability with other packages or in other environments
  • it removes 4 dependencies that need to be managed/bumped/etc, so in a way is "lighter"

I just shared my suggestion. but i strongly believe moving to django-environ would a good move. even django core tried that way.

auvipy avatar Oct 27 '21 08:10 auvipy

Also in my humble opinion @pauloxnet reasoning on blocking this is not valid. even if he is maintaining this project he do not have enough contribution history to the project. I am also interested to join the team as well. no offense just sharing my honest thoughts.

auvipy avatar Oct 27 '21 08:10 auvipy

Also in my humble opinion @pauloxnet reasoning on blocking this is not valid. even if he is maintaining this project he do not have enough contribution history to the project. I am also interested to join the team as well. no offense just sharing my honest thoughts.

No offense at all, you're totally right, but at the same time I'm using this package in a lot of projects as many other users I think that want their projects continue running.

This is PR is a huge changes for this project, it add a totally new dependency and it's not retro compatible.

If you really think start using django-environ is a good move for the project then we have to define a strict goal checks to verify that ti move will not brake project using it and replace all current features (e.g. I see some tests has been removed and it's seems because django-environ can't pass them).

However I think it's a better idea to release the 2.3 version.

pauloxnet avatar Oct 27 '21 10:10 pauloxnet

it would be better in a v3.0 release

auvipy avatar Oct 27 '21 10:10 auvipy