Giter VIP home page Giter VIP logo

Comments (8)

shakfu avatar shakfu commented on June 20, 2024 1

FYI, I have just added a pull request PR-158 which enables building an extension without any build system except zig's:

python -m pydust build --generate-stubs --ext-name 'fib._lib' --ext-path 'fib/fib.zig'

This builds the fibonnaci example in-place with optional stub generation enabled.
Note that each --ext-name and --ext-path pair can be repeated for multiple extensions.

from ziggy-pydust.

gatesn avatar gatesn commented on June 20, 2024

Regarding the v11 zig, you should be able to set zig_exe = <path> in your pyproject.toml - although that sort of requires a Poetry pyproject.toml!!

Are you saying you'd like to use the project without any Python-specific build system at all? I do think that's doable, but it would require us building the tools to generate valid wheels and source dists, etc.

from ziggy-pydust.

shakfu avatar shakfu commented on June 20, 2024

@gatesn Thanks for your reply

Regarding the v11 zig, you should be able to set zig_exe = in your pyproject.toml - although that sort of requires a Poetry pyproject.toml!!

Understood 👍

Are you saying you'd like to use the project without any Python-specific build system at all? I do think that's doable, but it would require us building the tools to generate valid wheels and source dists, etc.

Not at all. I understand the convenience that poetry provides given its wholistic approach, but I am just curious about the hypothetical minimal requirement to run ziggy-pydust in a project. Could it be done, for example, with just a pip install -r requirements.py.. What are the extras beyond that? a virtualenv, zig executable in path, generation of build.zig, ... ? if these are known then I'd like to have a go at creating a script to enable project creation outside of poetry...

from ziggy-pydust.

gatesn avatar gatesn commented on June 20, 2024

Ah gotcha. So with ziggy-pydust in your environment, the main build script is here: https://github.com/fulcrum-so/ziggy-pydust/blob/develop/pydust/build.py#L20

We may need a small refactor to builzig so it accepts config as an argument instead of loading it itself. (https://github.com/fulcrum-so/ziggy-pydust/blob/7291db36ec6ac2362671acdfd75ec83569f45fbf/pydust/buildzig.py#L36)

That way, you could build your own config object (https://github.com/fulcrum-so/ziggy-pydust/blob/7291db36ec6ac2362671acdfd75ec83569f45fbf/pydust/config.py#L45) and then invoke the build.

Similarly, the pytest_plugin.py might need its own way to load some config.

You should be able to try this out by cloning the repo and then pip install -e ../ziggy-pydust or wherever you've cloned it to.

from ziggy-pydust.

shakfu avatar shakfu commented on June 20, 2024

Thanks very much for your help and guidance. I'll revert back if I have something worth sharing...

from ziggy-pydust.

slonik-az avatar slonik-az commented on June 20, 2024

Just some thoughts: Python has at least three popular package managers. Besides Poetry they are pip and anaconda (dominant in data science). Providing clear dependencies list would help to adopt ziggy-pydust to other package managers and extend its user base.

from ziggy-pydust.

alexporter8013 avatar alexporter8013 commented on June 20, 2024

Just some thoughts: Python has at least three popular package managers. Besides Poetry they are pip and anaconda (dominant in data science). Providing clear dependencies list would help to adopt ziggy-pydust to other package managers and extend its user base.

Hello all, I'm new to this repo, but what I would recommend would be to take a look at https://github.com/pypa for "official" build systems in addition to poetry and conda to cover the 1st and popular 3rd party build tools.

from ziggy-pydust.

shakfu avatar shakfu commented on June 20, 2024

An update: PR-158 has been merged, and as of release .0.12.1 the command line api for the new build subcmd is:

usage: pydust build [-h] [-z ZIG_EXE] [-b BUILD_ZIG] [-m] [-a]
                         [-e EXTENSIONS [EXTENSIONS ...]]

options:
  -h, --help            show this help message and exit
  -z ZIG_EXE, --zig-exe ZIG_EXE
                        zig executable path (default: None)
  -b BUILD_ZIG, --build-zig BUILD_ZIG
                        build.zig file (default: build.zig)
  -m, --self-managed    self-managed mode (default: False)
  -a, --limited-api     use limited python c-api (default: True)
  -e EXTENSIONS [EXTENSIONS ...], --extensions EXTENSIONS [EXTENSIONS ...]
                        space separated list of extension '<name>=<path>'
                        entries (default: None)

The earlier api has changed to the more intuitive form for multiple extensions:

python -m pydust build --extensions 'fib._lib=fib/fib.zig' 'fib._hello=fib/hello.zig'

from ziggy-pydust.

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.