Comments (8)
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.
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.
@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.
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.
Thanks very much for your help and guidance. I'll revert back if I have something worth sharing...
from ziggy-pydust.
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.
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.
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)
- buildzig.py's sysconfig.get_config_var("LDLIBRARY") fails on Windows HOT 5
- Support GIL management
- Support Python base classes
- py.isinstance should support Pydust types
- Support __del__ method on modules (with m_free slot)
- Support *args and **kwargs
- Support tracebacks for non PyExc exceptions
- Convention for returning new/borrowed references
- Add py.alloc HOT 1
- Action Required: Fix Renovate Configuration
- Should produce error when non kwargs args follow variadic args HOT 1
- Unexpectedly slow class method calls HOT 2
- Provide fast conversion from `PyObject` to Pydust type struct
- Store PyType objects on module state
- GC traverse and clear should traverse plain structs
- Is pydust still in active development? HOT 2
- Support creating PyLong from arbitrary sized integers
- Using Pydust to Embed a Python Interpreter
- sysconfig.get_config_var("LDLIBRARY") is now defined in Windows Python v3.13.0b1
- License template is not populated.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ziggy-pydust.