Thibauth / python-pushover

Comprehensive bindings and command line utility for the Pushover notification service
GNU General Public License v3.0
182 stars 53 forks source link

Use_2to3 has been removed from setuptools. No longer builds. #42

Open mcondren opened 3 years ago

mcondren commented 3 years ago

https://setuptools.pypa.io/en/latest/history.html#v58-0-0

No longer installs it throws a

`bash-5.1# pip3 install python-pushover Collecting python-pushover Using cached python-pushover-0.4.tar.gz (19 kB) ERROR: Command errored out with exit status 1: command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rdilmzkd/python-pushover/setup.py'"'"'; file='"'"'/tmp/pip-install-rdilmzkd/python-pushover/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-d0zpskx4 cwd: /tmp/pip-install-rdilmzkd/python-pushover/ Complete output (1 lines): error in python-pushover setup command: use_2to3 is invalid.

`

due to a call to use_2to3 in setup.py.

chrisjohnson00 commented 3 years ago

Workaround:

Install setuptools 57.x.x

For example:

    pip install --upgrade pip setuptools==57.5.0
    pip install --upgrade python-pushover
    pip freeze > requirements.txt
mcondren commented 3 years ago

Yes, thanks. On my own system I used 2to3 to convert the 3 code file permanently and then removed it as a requirement, however there are third-party docker containers that pull this API in and do pip installs on startup each time. My request was a fix at the source and in the pip repo so that the workarounds weren’t needed downstream.

chrisjohnson00 commented 2 years ago

Understood and agreed... given the last release on this repo was in 2018, I figured others might land here and find the workaround helpful.

laurent-radoux commented 2 years ago

I encounter the same issue for one of my projects which makes it impossible to run tests via tox. https://github.com/laurent-radoux/wanikani_notifier

Does anyone know what I could do?

mcondren commented 2 years ago

I had to do a few things. Run all the .py files through 2_to_3, and also modify one of the the iteration methods to use the python 3 method of iteration. I could submit a PR, but I see an unapproved PR from last year, so I don’t want to put in that time to figure out how to submit it, if it won’t get merged.

laurent-radoux commented 2 years ago

Ok, thanks for the info.

Does that mean I should fork this repo, update it according to your instructions and reference the fork as a requirement for the projet that depends on this package?

roseeng commented 2 years ago

If you don't need exactly this package, a suggestion to people who come here is to use https://github.com/Wyattjoh/pushover

pip install git+https://github.com/Wyattjoh/pushover

karolzlot commented 2 years ago

Another solution is to switch to this fork which solves the issue: https://github.com/almir1904/python-pushover

I think it is good idea to star it, so it will at some point become default (when number of stars will be greater than stars here).

You can add in requirements.txt:

--editable=git+https://github.com/almir1904/python-pushover.git#egg=python-pushover
mcondren commented 2 years ago

I ended up dumping pushover in HA and using the node-red pushover node for alerting in my automation flows. That gets around these issues as it’s kept updated.

mcelhennyi commented 2 years ago

Another solution is to switch to this fork which solves the issue: https://github.com/almir1904/python-pushover

I think it is good idea to star it, so it will at some point become default (when number of stars will be greater than stars here).

You can add in requirements.txt:

--editable=git+https://github.com/almir1904/python-pushover.git#egg=python-pushover

I am not seeing a "Client" in the api, is this not a full fork?

dchevell commented 2 years ago

Another solution is to switch to this fork which solves the issue: https://github.com/almir1904/python-pushover I think it is good idea to star it, so it will at some point become default (when number of stars will be greater than stars here). You can add in requirements.txt:

--editable=git+https://github.com/almir1904/python-pushover.git#egg=python-pushover

I am not seeing a "Client" in the api, is this not a full fork?

@mcelhennyi you'll notice that this repo has also dropped the Client class, the fork just reflects that. See https://github.com/Thibauth/python-pushover/pull/27

(Caught me by surprise too, especially since docs were never updated)