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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate werkzeug.script #1090

Merged
merged 6 commits into from Mar 30, 2017
Merged

Deprecate werkzeug.script #1090

merged 6 commits into from Mar 30, 2017

Conversation

@aaossa
Copy link
Contributor

@aaossa aaossa commented Mar 28, 2017

This PR is directly related to #1079: "Fully deprecate werkzeug.script". These items must be solved before merge:

  • In werkzeug/contrib/profiler.py the make_action method is related to the deprecated module. Should we drop the method, drop profiler.py or leave it? SOLVED: Leave it 馃檶
  • In each manage-X.py in the examples folder, werkzeug.script is imported (see manage-coolmagic.py for instance). We could replace it using click and explaining what click does in examples/README. Should I add it in this PR or another? SOLVED: 8098d03
  • In docs and comments I've been using "pallets/click" to make reference to the click module. Is this ok or should I use click instead? SOLVED: e722cb7

Waiting for your input 馃憣

aaossa added 3 commits Mar 28, 2017
This commit deletes werkzeug/script.py, suggest using pallets/click
instead of werkzeug.script for bigger applications and deletes script
module from being loaded in werkzeug/__init__.py

Signed-off-by: Antonio Ossa <aaossa@uc.cl>
As suggested in the corresponding issue, click is the recommended
replacement

#1079 (comment)

Signed-off-by: Antonio Ossa <aaossa@uc.cl>
Signed-off-by: Antonio Ossa <aaossa@uc.cl>
@untitaker
Copy link
Member

@untitaker untitaker commented Mar 28, 2017

In werkzeug/contrib/profiler.py the make_action method is related to the deprecated module. Should we drop the method, drop profiler.py or leave it?

I don't think it's very werkzeug.script-specific, we should leave it in. We don't really have a choice since we never deprecated it.

In each manage-X.py in the examples folder, werkzeug.script is imported (see manage-coolmagic.py for instance). We could replace it using click and explaining what click does in examples/README. Should I add it in this PR or another?

Yes please, in this PR.

In docs and comments I've been using "pallets/click" to make reference to the click module. Is this ok or should I use click instead?

In either case please link to http://click.pocoo.org when introducing it.

@@ -63,7 +63,7 @@ suggesting alternatives even if they will stick around for a longer time.
Do not use:

- `werkzeug.script`, replace it with custom scripts written with
`argparse` or something similar.
`argparse`, pallets/click or something similar.
Copy link
Member

@ThiefMaster ThiefMaster Mar 28, 2017

I'd just call it click. Right not it looks a bit like messed-up copy&paste to me ;)

Every manage-<example>.py file used werkzeug.script a deprecated (and
now definitely removed) module. The new cli are powered by click [1]

[1]: https://github.com/pallets/click

Signed-off-by: Antonio Ossa <aaossa@uc.cl>
@aaossa aaossa changed the title Deprecate werkzeug.scripts Deprecate werkzeug.script Mar 29, 2017
This commit updates docs and comments to recommend `click` and display
the `click` website ([1]) when possible

[1]: http://click.pocoo.org

Signed-off-by: Antonio Ossa <aaossa@uc.cl>
@aaossa
Copy link
Contributor Author

@aaossa aaossa commented Mar 29, 2017

Travis says everything is ok 馃檶 Can you please review this before merge @untitaker @ThiefMaster ? 馃榿 Thanks

@untitaker
Copy link
Member

@untitaker untitaker commented Mar 29, 2017

Yeah those examples are good. However, the Travis tests don't cover them at all. Did you get those running? Otherwise LGTM

Some changes were made in `couchdb` and `werkzeug`. It's time to
update our examples. Now they should work on Python 2.

Signed-off-by: Antonio Ossa <aaossa@uc.cl>
@aaossa
Copy link
Contributor Author

@aaossa aaossa commented Mar 29, 2017

@untitaker Almost all of them work, except for:

  • i18nurls: Uses werkzeug.templates, and it seems like it was deprecated a while ago. (Maybe Jinja could be used)

I just tried using Python 2 (2.7.10), because most of the examples are not compatible with Python 3. Maybe in the future the examples could be updated to be compatible with Python 3 too.

@untitaker untitaker merged commit ee959e2 into pallets:master Mar 30, 2017
1 check failed
@untitaker
Copy link
Member

@untitaker untitaker commented Mar 30, 2017

Thanks! The other stuff should be a separate PR. Ideally we'd have simple tests for each example like in Flask.

@davidism davidism added this to the 0.13 milestone Dec 5, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants