jithurjacob / Windows-10-Toast-Notifications

Python library to display Windows 10 Toast Notifications
MIT License
970 stars 168 forks source link

Building with pip version > 10 #59

Open Frozander opened 4 years ago

Frozander commented 4 years ago

So while building the project, I have encountered an issue with pip module while in setup.py

In pip versions greater than 10 parse_requirements is in pip._internal.req instead of pip.req. Here is a snippet on how I fixed it.

diff --git a/setup.py b/setup.py
index 8ead33e..a1ef1ad 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,10 @@
 from operator import attrgetter
 from os import path

-from pip.req import parse_requirements
+try: # for pip >= 10
+    from pip._internal.req import parse_requirements
+except ImportError: # for pip <= 9.0.3
+    from pip.req import parse_requirements
 from setuptools import setup

 def read(fname):
Frozander commented 4 years ago

Created pull request #60