Code Monkey home page Code Monkey logo

Comments (3)

dakra avatar dakra commented on August 15, 2024 1

Thanks for you comment.

I went with the distutils version as that's the most stable.
Your tuple function would e.g. break with "0.18a" etc.

I'm leaving this ticket open for now as I also think it would be
nice to at least automatically update the patch version or
make it configurable what jedi version should be installed.
(PRs welcome ;) )

from anaconda-mode.

Mekk avatar Mekk commented on August 15, 2024

Code-wise: the responsible lines are
https://github.com/pythonic-emacs/anaconda-mode/blob/master/anaconda-mode.el#L116
and
https://github.com/pythonic-emacs/anaconda-mode/blob/master/anaconda-mode.el#L157
and
https://github.com/pythonic-emacs/anaconda-mode/blob/master/anaconda-mode.el#L172

If it's to stay more-or-less this way, I'd suggest specyfying both sides, sth like

jedi_dep = ('jedi', '0.13.0', '0.18')   # min req. version, min illegal version
# …
missing_dependencies.append('{0}>={1},<{2}'.format(*jedi_dep))
# …
assert jedi.__version__ >= jedi_dep[1] and jedi.__version__ < jedi_dep[2], 'Jedi version should be >= %s and < %s, current version: %s' % (jedi_dep[1], jedi_dep[2], jedi.__version__,)

except the assert is invalid (text comparison doesn't work properly here, one must compare versions numerically, there are various libraries which can do it, I am not sure which one is appropriate here)

from anaconda-mode.

Mekk avatar Mekk commented on August 15, 2024

Patch above solves most important part of the issue, by forcing specific jedi version when one is to be installed. Still, there are two minor issues to consider:

a) Patched version switches to strict version (installs jedi==0.17.2 or jedi==0.18.0 depending on python version). Mayhaps it would make sense to allow for patchnumber upgrade (say, to install 0.17.3/0.18.1 if such version is released). Not 100% sure though.

b) Patch does not properly fix assert statement, leaving it as

assert jedi.__version__ >= jedi_dep[1], 'Jedi version should be >= %s, current version: %s' % (jedi_dep[1], jedi.__version__,)

(

assert jedi.__version__ >= jedi_dep[1], 'Jedi version should be >= %s, current version: %s' % (jedi_dep[1], jedi.__version__,)
)
The problem is that in case very old jedi (say 0.8.0) is installed, this assert will be glad to accept such version without complaints, as alphabetically "0.8.0" >= "0.18.0").
I am not sure about this part, mayhaps it should be dropped altogether or mayhaps instead of failing anaconda should upgrade to proper version, but if it is to stay, alphabetical comparison is incorrect. Sth like distutils.version.LooseVersion(jedi.__version__) >= distutils.version.LooseVersion(jedi_dep[1]) or mayhaps packaging.version.LegacyVersion, or even simple twoliner

def versiontuple(v):
    return tuple(int(x) for x in v.split("."))

from anaconda-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.