vsudilov / flask-consulate Goto Github PK
View Code? Open in Web Editor NEWflask extension that enables an interface to consul via a flask.app
License: MIT License
flask extension that enables an interface to consul via a flask.app
License: MIT License
The package is unimportable without six
, but this is spec'd as only a dev dependency. This probably never got noticed because six
is such a common dependency, and I suspect that flask
iself removed it at some point, so this is probably only triggered with newer installs.
~/d/p/flask-consulate (feature/24-conditional-log-serialization↑1|✔)
11:14:40 $ vf new -p python3.8 flask-consulate-issue
Creating flask-consulate-issue via /home/jrloc/.pyenv/shims/python3.8 …
(flask-consulate-issue) ~/d/p/flask-consulate (feature/24-conditional-log-serialization↑1|✔)
11:16:35 $ pip install flask-consulate
Processing /home/jrloc/.cache/pip/wheels/27/2c/31/b858f1eaef22eb5d166ba634cd8bd92965252bc4a647c02422/flask_consulate-0.2.0-py3-none-any.whl
Collecting requests>=2.7.0
Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Processing /home/jrloc/.cache/pip/wheels/7f/d5/9f/6c81c93c6d88b86b3abb8b9ed0f5f659414b2c5fde9405adc9/consulate-0.6.0-py3-none-any.whl
Collecting Flask
Using cached Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Processing /home/jrloc/.cache/pip/wheels/3c/cc/a1/efc7a5933bcbe2e17c8e6eb5d40267305cbd1a3d70ba27fc3b/dnspython3-1.15.0-py3-none-any.whl
Collecting idna<3,>=2.5
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
Collecting chardet<5,>=3.0.2
Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
Collecting itsdangerous>=0.24
Using cached itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Jinja2>=2.10.1
Using cached Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting Werkzeug>=0.15
Using cached Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Collecting click>=5.1
Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting dnspython==1.15.0
Using cached dnspython-1.15.0-py2.py3-none-any.whl (177 kB)
Collecting MarkupSafe>=0.23
Using cached MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl (32 kB)
Installing collected packages: idna, urllib3, chardet, certifi, requests, consulate, itsdangerous, MarkupSafe, Jinja2, Werkzeug, click, Flask, dnspython, dnspython3, flask-consulate
Successfully installed Flask-1.1.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 certifi-2020.12.5 chardet-4.0.0 click-7.1.2 consulate-0.6.0 dnspython-1.15.0 dnspython3-1.15.0 flask-consulate-0.2.0 idna-2.10 itsdangerous-1.1.0 requests-2.25.1 urllib3-1.26.2
WARNING: You are using pip version 20.0.2; however, version 20.3.3 is available.
You should consider upgrading via the '/home/jrloc/.virtualenvs/flask-consulate-issue/bin/python -m pip install --upgrade pip' command.
(flask-consulate-issue) ~/d/p/flask-consulate (feature/24-conditional-log-serialization↑1|✔) (1)
11:17:08 $ python -c 'from flask_consulate import Consul'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/jrloc/devel/py/flask-consulate/flask_consulate/__init__.py", line 4, in <module>
from flask_consulate.consul import Consul
File "/home/jrloc/devel/py/flask-consulate/flask_consulate/consul.py", line 8, in <module>
from six import iteritems
ModuleNotFoundError: No module named 'six'
This should be automated; we can set up travis to do this for us.
Although this is tested in gmr/consulate, it would be worthwhile to add tests to ensure that app.config gets expected types
From @vsudilov on July 22, 2015 14:54
The current implementation that heavily relies on dnspython is opaque and exceedingly difficult to test; This should be improved.
Copied from original issue: adsabs/adsws#74
The log statements in flask_consulate.consul:Consul.apply_remote_config
unconditionally format strings, even if the log level isn't met. For larger data structures and frequent updates, this can be a lot of wasted work for data that never gets logged (assuming we're not at debug level anyways).
https://docs.python.org/3/howto/logging.html#logging-variable-data
I'll submit a PR shortly for this
Please, consider adding support for setup like so: https://github.com/tolitius/cault
That would be awesome!
ie things like the meta block for services, deregister_after flag etc. Many of these are already supported in the underlying consulate package. However those have yet to be released :(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.