Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install with setuptools 58 - "error in jsmin setup command: use_2to3 is invalid." #33

Closed
serenecloud opened this issue Sep 7, 2021 · 12 comments · Fixed by #34

Comments

@serenecloud
Copy link
Contributor

When trying to install jsmin 2.2.2 from a requirements.txt file using a python environment with setuptools 58 the following failure is happening for us on centos:

Collecting jsmin==2.2.2
  Downloading jsmin-2.2.2.tar.gz (12 kB)
    ERROR: Command errored out with exit status 1:
     command: /opt/pact-virtual-environment/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p9xovusy/jsmin_25a28adbd1db497daf15f6eb22893f8a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p9xovusy/jsmin_25a28adbd1db497daf15f6eb22893f8a/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-8_iwpxdk
         cwd: /tmp/pip-install-p9xovusy/jsmin_25a28adbd1db497daf15f6eb22893f8a/
    Complete output (1 lines):
    error in jsmin setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/17/73/615d1267a82ed26cd7c124108c3c61169d8e40c36d393883eaee3a561852/jsmin-2.2.2.tar.gz#sha256=b6df99b2cd1c75d9d342e4335b535789b8da9107ec748212706ef7bbe5c2553b (from https://pypi.org/simple/jsmin/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement jsmin==2.2.2 (from versions: 2.0, 2.0.1, 2.0.2, 2.0.2.post1, 2.0.3, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2.0, 2.2.1, 2.2.2)
ERROR: No matching distribution found for jsmin==2.2.2

This looks to be happening because setuptools 58 added a breaking change to remove use_2to3 support: https://setuptools.readthedocs.io/en/latest/history.html#v58-0-0

#2086: Removed support for 2to3 during builds. Projects should port to a unified codebase or pin to an older version of Setuptools using PEP 518 build-requires.

pypa/setuptools#2769

It would be awesome if this could be updated, but until then, if you're also getting this issue, try setuptools 57.5.0.

@tikitu
Copy link
Owner

tikitu commented Sep 7, 2021

I'm no longer maintaining this project. Thanks for the workaround pinning setuptools! I'll leave this issue open so that anyone else with the same problem can find it.

NicolasMassart added a commit to alexandratran/besu-docs that referenced this issue Sep 7, 2021
see tikitu/jsmin#33

Signed-off-by: Nicolas MASSART <nicolas.massart@consensys.net>
NicolasMassart added a commit to hyperledger/besu-docs that referenced this issue Sep 7, 2021
* update genesis file content

Signed-off-by: Alexandra Tran <alexandra.tran@consensys.net>

* remove minify because of bug

see tikitu/jsmin#33

Signed-off-by: Nicolas MASSART <nicolas.massart@consensys.net>

Co-authored-by: Nicolas MASSART <nicolas.massart@consensys.net>
@MichaIng
Copy link

MichaIng commented Sep 7, 2021

Faced the same issue. Thanks for providing the workaround, which works fine here as well.

MichaIng added a commit to MichaIng/DietPi-Docs that referenced this issue Sep 7, 2021
+ as of tikitu/jsmin#33
+ and to match our servers Python version
MichaIng added a commit to MichaIng/DietPi-Docs that referenced this issue Sep 7, 2021
* Update VM image downloads and complement RPi variants
* Fix jsmin build and use Python 3.9.7
    as of tikitu/jsmin#33
    and to match our servers Python version
* Complement wordlist
@facelessuser
Copy link

While locking setup tools is a temporary solution, it will make using this project essentially dead in the future. It probably wouldn't be a bad idea at least to run the conversion from 2to3 on the project and just cut a new Python 3 only release (Python 2 is dead, and the last version can still be used for it). It would at least give this project some more longevity until/if someone wants to help with maintainership.

@facelessuser
Copy link

facelessuser commented Sep 7, 2021

If it would be merged, I would be willing to create a pull to get a Python3 only release out the door. But if pulls will not be merged, I won't bother. Please let me know if a pull would be considered.

@MichaIng
Copy link

MichaIng commented Sep 7, 2021

Agreed! While its good somehow to have that build failure as last shot call to switch to a different maintained JavaScript minifier, it would be good to have more time (without frozen setuptools) for this migration to bubble up dependency tails.

Please let me know if a pull would be considered.

and if a new release to PyPI can be done accordingly to have pip pulling that fix.

@serenecloud
Copy link
Contributor Author

Ok, I've added #34 to remove Python 2 support. My testing was not exhaustive, but it was a pretty small change and it worked fine for me on Python 3.6.9.

@jromal
Copy link

jromal commented Sep 15, 2021

Any news about this pull request?
Python 2 is dead and to use an old version of setuptools is still acceptable, but not for long term.

@MichaIng
Copy link

Just read what is actually told in the pull request 😄:

Thanks very much! I will dig up my pypi credentials and get this published, but I'm about to spend some days up a mountain: just in case something unexpected happens I would rather do that when I'm back down and can fix any mistakes I might make quickly. If you didn't see this merged and published by 2021-09-17 please feel free to poke me, I can't see anything that should delay me so long.

@serenecloud
Copy link
Contributor Author

Thanks for releasing this @tikitu!

@tikitu
Copy link
Owner

tikitu commented Sep 17, 2021

You're welcome, thanks for making it so easy for me to do so!

@MichaIng
Copy link

Release is on PyPI: https://pypi.org/project/jsmin/

Many thanks 👍!

dragon-dxw added a commit to nhsx/nhsx-website that referenced this issue Oct 7, 2021
tikitu/jsmin#33
Caused by the release of setuptools 58 on Sep 5 2021, which is
not version controlled when brought into the Dockerfile via
pip install --upgrade setuptools which lead to builds failing without
code changes.
jeertmans added a commit to ADE-Scheduler/ADE-Scheduler that referenced this issue Oct 12, 2021
jamesrwhite pushed a commit to sketch-hq/response that referenced this issue Nov 1, 2021
- It appears to be unused and the upstream project is seemingly unmaintained
- It also blocks installs when using versions of setuptools > 57.5.0
  due to the same issue described in: tikitu/jsmin#33
jamesrwhite pushed a commit to sketch-hq/response that referenced this issue Nov 3, 2021
- It appears to be unused and the upstream project is seemingly unmaintained
- It also blocks installs when using versions of setuptools > 57.5.0
  due to the same issue described in: tikitu/jsmin#33
mikenewbon pushed a commit to mikenewbon/blender-studio that referenced this issue Nov 4, 2021
Version 2.2.2 is not longer compatible with setuptools
due to use of 2to3. Version 3.0.0 removes support of Python 2.
See tikitu/jsmin#33 for more details.
liam-mitchell21 added a commit to zovoilis-lab/nanocompore that referenced this issue Jan 25, 2022
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jul 9, 2022
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Jul 11, 2022
@Gerryjj
Copy link

Gerryjj commented Jul 23, 2022

Applies to GOOEY and setuptools.
FIXED...see below
I still can't install GOOEY with provided build with the problem related back to setuptools>58
I need Gooey because of another app which depends on it.
Placed an issue at
chriskiehl/Gooey#824
the wxpython build fails.
I tried setting setuptools to 57 and 58 but the import fails.
Looking for any workaround.

...
This workaround seems to work albeit only with setuptools=57.5
first.
https://morioh.com/p/1c920e8e864e

surapunoyousei pushed a commit to Floorp-Projects/Floorp that referenced this issue Aug 24, 2022
surapunoyousei pushed a commit to Floorp-Projects/Floorp that referenced this issue Sep 13, 2022
surapunoyousei pushed a commit to Floorp-Projects/Floorp that referenced this issue Sep 13, 2022
surapunoyousei pushed a commit to Floorp-Projects/Floorp that referenced this issue Oct 6, 2022
snim2 pushed a commit to nhsx/nhsx-website that referenced this issue Nov 20, 2023
tikitu/jsmin#33
Caused by the release of setuptools 58 on Sep 5 2021, which is
not version controlled when brought into the Dockerfile via
pip install --upgrade setuptools which lead to builds failing without
code changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants