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

Conversation

Projects
None yet
4 participants
@aaossa
Copy link
Contributor

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 some commits Mar 28, 2017

Drop werkzeug.script from main code
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>
Suggest pallets/click to replace werkzeug.script
As suggested in the corresponding issue, click is the recommended
replacement

#1079 (comment)

Signed-off-by: Antonio Ossa <aaossa@uc.cl>
Add deprecation note to CHANGES
Signed-off-by: Antonio Ossa <aaossa@uc.cl>
@untitaker

This comment has been minimized.

Copy link
Member

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.

This comment has been minimized.

Copy link
@ThiefMaster

ThiefMaster Mar 28, 2017

Member

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

Update examples
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

Recommend `click` to replace `werkzeug.script`
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

This comment has been minimized.

Copy link
Contributor Author

commented Mar 29, 2017

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

@untitaker

This comment has been minimized.

Copy link
Member

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

Update examples code
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

This comment has been minimized.

Copy link
Contributor Author

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

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@untitaker

This comment has been minimized.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.