Coder Social home page Coder Social logo

Comments (4)

blankdots avatar blankdots commented on May 19, 2024

looking at the dependencies it seems to be caused by jsonschema:

+--- pypi:connexion:1.0.129
|    +--- pypi:jsonschema:2.5.1
|    |    +--- pypi:argparse:1.4.0
|    |    +--- pypi:repoze.lru:0.6
|    |    \--- pypi:functools32:3.2.3-2

Relate issue: python-jsonschema/jsonschema#228 which apparently it should work with Python3, however the problem still appears.

from pygradle.

zvezdan avatar zvezdan commented on May 19, 2024

This happens because the Ivy files do not have the information about the conditional dependencies.
The Python package metadata (when you install in virtualenv) contain the info about functools32 that limits it to be used with Python 2.7 only (environment markers).

We have solved this internally at LinkedIn last summer. We are able to build libraries that: (a) declare support for multiple versions of Python and get built/tested with each such version, and (b) declare the conditional dependencies so that the environment markers are correctly recorded in the Python package metadata.

Unfortunately, we still did not have time to port these two extensions or the changes to the DistGradle class (used in our setup.py) that are needed to support these features in the open-source pygradle. We are going to work on that as other priorities allow.

In the meantime, you could use Gradle's features and Groovy's if statement to exclude the dependencies based on the version of Python interpreter used for the build. That does not scale well for hundreds of products, but can allow you to build a handful of them with Python 3.
Alternatively (and this scales better), you could use your own package repo, where you could store the packages processed with Python 2 separately from those processed with Python 3. That way, the transitive dependencies will not creep in from Python 2 into Python 3 builds.

Notice that pyvi is only a simple example to get users quickly up-and-running with pygradle. Internally, we use a much more sophisticated Python uploader that can use Python 2 or 3 as needed and a professional artifactory repo with python package index. We use a single repo thanks to the above mentioned extensions that allow us to process conditional dependencies correctly.

from pygradle.

blankdots avatar blankdots commented on May 19, 2024

@zvezdan thank you for the answer.
I was thinking more and more of seting up my own artifact repository as I have issues with several dependencies, some which are as wheels and I know there is an open issue about that #46
Meanwhile I was able to built it using the following Gradle construct:

dependencies {
    python ('pypi:connexion:1.0.129') {
        exclude module: 'functools32'
    }
}

There are still some issues which I was not able to solve (a.k.a. did not have time had time to look into) so I cannot say it builds properly, but at least it does not get stuck anymore.

from pygradle.

blankdots avatar blankdots commented on May 19, 2024

Closing this as I think it addressed the main question.

from pygradle.

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.