Comments (11)
I've looked at #15, but I don't understand the issue. Surely the package names and numbers reported via pip are the ones that you want to report, rather than the value of some internal attribute.
from watermark.
Is there a reason why _get_packages doesn't use
pkg_resources
to get the package version numbers, like pip does?
Honestly has been so long that I don't remember why I chose one over the other, but I think pkg_resources
does not work with older versions of Python setuptools?
I think it's useful to support these Python versions for people who deliberately have to use an old python version on a webserver or so. On the other hand, this is a IPython magic command, so there may not be an intersection of people who have IPython installed but yet have such an old setuptools version.
So I agree with you changing to pkg_resources
makes sense
from watermark.
I'm happy to make these changes when I have time, but it will be a major version since it changes the meaning of the -p flag (from modules to packages).
It is worth dropping guaranteed support for Python 2 at the same time? i.e. for version 2.0. IPython hasn't supported it 2 major versions ago. https://python3statement.org/. In fact, IPython 7.0+ only supports Python 3.5 and above.
from watermark.
It is worth dropping guaranteed support for Python 2 at the same time?
That's a tough question. Making features like this easier to implement is exactly the reason why I think people should "slowly" start about dropping Py 2 support if they haven't done so already.
However, pip install ipython
it will still install IPython no matter which Python version you have, and one of the use cases of this package is to find out more about the environment that a user used to run/execute particular code (when my students have questions regarding hw submissions, it's super handy to tell them to execute %watermark ...
in the notebook and report back the output of this.
So, I am afraid dropping Py2 makes this less useful, because people who are voluntarily or involuntarily using Python 2.7 but then unable to install watermark for a reason unknown to them (thinking of beginners), and then it will just be another hurdle to them to find out why they can't install it etc..
Anyways, usually, I am in favor of dropping Py 2 support, but maybe we shouldn't do that just yet. I do think though a (deprecation) warning should be displayed if a person runs watermark in IPython on Python 2.7 as a start.
from watermark.
If the change was made in v2.0 then v1.x would still install on Python 2.7 just as IPython 5.x does
from watermark.
That sounds good to me then. Have never done that before -- you are basically saying we can specify the IPython/Python dependency of the 2.0 version somewhere in the setup.py file so that people on Python 2.7 get the correct (compatible) 1.7 version when they run pip install watermark
?
from watermark.
Started work on this here: https://github.com/jamesmyatt/watermark/tree/v2-pre
I also noticed that some of the methods already use the Python 3 print function without importing from future:
watermark/watermark/watermark.py
Line 236 in 3f2c75a
from watermark.
Good point. That's a contributed function, personally, I don't use format
, just didn't think about it when I merged it. But wouldn't it also still work in Python 2.7?
from watermark.
I think that str.format was backported from Python 3.0 to Python 2.6
from watermark.
Should be addressed now via #54 (using pkg_resources)
from watermark.
Thanks for doing this 👍
I've been on parental leave, so I've only just noticed 😆
from watermark.
Related Issues (20)
- Supporting nested library imports via `-iv`
- version unknown HOT 4
- --iversions returns an error if no package has been imported HOT 1
- Timezone name has no trailing space HOT 2
- Python 3.8's new metadata package
- support -iv edge cases? HOT 1
- cli version HOT 5
- Python 2.7 and 3.5 EOL HOT 1
- Adopt NEP 29?
- setup.py fails unless all install_requires are already installed HOT 1
- Missing space before timezone HOT 5
- Watermark fails to recognize all project used libraries HOT 1
- `-d` doesn't print date, only when combined with `-u` HOT 1
- Watermark fails to identify (some) packages when imported as 'from X import Y' HOT 13
- Error UsageError on author argument HOT 1
- Is it possible to blur background? HOT 1
- Remove Travis CI config and replace build status badge with AppVeyor? HOT 2
- New feature to check for latest packages
- Include information about how Python was installed HOT 2
- Determine what version of jupyter notebook the code is currently being run in HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watermark.