Git Product home page Git Product logo

Comments (5)

danilopeixoto avatar danilopeixoto commented on July 28, 2024 1

@awni While this problem might not be directly related to the issue, I wanted to share my following experience:

When installing the mlx package using pip install mlx==0.0.10 and importing the mlx.core module in VS Code for macOS, I cannot access type annotations. I had to manually generate the mlx.core stubs and copy them to the mlx package folder. Unfortunately, the type annotations for the mlx.core module didn't seem to work out of the box for me.

Should we include the *.pyi files as package_data?

from mlx.

awni avatar awni commented on July 28, 2024

Could you be more specific?

Most of the python API is built with pybind11 which includes types in the function signatures (e.g. help(mx.add) should show you the types) and the docs (e.g. add) shows the types of parameters.

The part that is written in python includes type annotations for the most part and we are happy to add / accept contributions where missing.

from mlx.

awni avatar awni commented on July 28, 2024

Closing for now, please reopen if you I am missing something.

from mlx.

awni avatar awni commented on July 28, 2024

Hmm that's a good point. We could potentially include them in the pypi wheels 🤔

from mlx.

danilopeixoto avatar danilopeixoto commented on July 28, 2024

@awni Would you provide recommendations for updating or simplifying the CI process to support stubs, in addition to the draft version specified below?

  build_release:
    machine: true
    resource_class: ml-explore/m-builder
    parameters:
      python_version:
        type: string
        default: "3.9"
      macos_version:
        type: string
        default: "14"
    steps:
      - checkout
      - run:
          name: Install dependencies
          command: |
            eval "$(conda shell.bash hook)"
            rm -r $CONDA_PREFIX/envs/runner-env
            conda create -y -n runner-env python=<< parameters.python_version >>
            conda activate runner-env
            pip install --upgrade cmake
            pip install --upgrade pybind11[global]
            pip install pybind11-stubgen
            pip install numpy
            pip install twine
      - run:
          name: Build python package
          command: |
            eval "$(conda shell.bash hook)"
            conda activate runner-env
            DEVELOPER_DIR=$(developer_dir_macos_<< parameters.macos_version >>) \
              PYPI_RELEASE=1 \
              CMAKE_BUILD_PARALLEL_LEVEL="" \
              python setup.py build_ext
            DEVELOPER_DIR=$(developer_dir_macos_<< parameters.macos_version >>) \
              PYPI_RELEASE=1 \
              CMAKE_BUILD_PARALLEL_LEVEL="" \
              python setup.py install
      - run:
          name: Generate stubs
          command: |
            eval "$(conda shell.bash hook)"
            conda activate runner-env
            python setup.py generate_stubs
      - run:
          name: Publish python package
          command: |
            eval "$(conda shell.bash hook)"
            conda activate runner-env
            DEVELOPER_DIR=$(developer_dir_macos_<< parameters.macos_version >>) \
              PYPI_RELEASE=1 \
              CMAKE_BUILD_PARALLEL_LEVEL="" \
              python setup.py bdist_wheel
            twine upload dist/* --repository mlx
      - store_artifacts:
          path: dist/

I would greatly appreciate any suggestions or insights you may have for simplifying or optimizing this CI configuration.

from mlx.

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.