Commit 71aa70cf by Sébastien Eustace Committed by Arun Babu Neelicattu

Display a deprecation message for Python 2.7 and 3.5

parent c264bc0f
import sys
from cleo import Application as BaseApplication from cleo import Application as BaseApplication
from poetry.__version__ import __version__ from poetry.__version__ import __version__
...@@ -38,6 +40,24 @@ class Application(BaseApplication): ...@@ -38,6 +40,24 @@ class Application(BaseApplication):
for command in self.get_default_commands(): for command in self.get_default_commands():
self.add(command) self.add(command)
if sys.version_info[:2] < (3, 6):
python_version = "<c1>{}</c1>".format(
".".join(str(v) for v in sys.version_info[:2])
)
poetry_feature_release = "<c1>1.2</c1>"
message = (
"\n"
"Python {} will no longer be supported "
"in the next feature release of Poetry ({}).\n"
"You should consider updating your Python version to a supported one.\n\n"
""
"Note that you will still be able to manage Python {} projects "
"by using the <c1>env</c1> command.\n"
"See <fg=blue>https://python-poetry.org/docs/managing-environments/</> "
"for more information."
).format(python_version, poetry_feature_release, python_version)
self._preliminary_io.write_line("<fg=yellow>{}</>\n".format(message))
@property @property
def poetry(self): def poetry(self):
from poetry.factory import Factory from poetry.factory import Factory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment