Comments (6)
After a change has been made to the build approach it should be tested as part of the release workflow in .github/workflows/release.yml
(although I'm assuming that it will work fine because we are only maturin
there ?). You can do that by going to https://github.com/stencila/stencila/actions/workflows/release.yml and only turning on Python SDK builds (for the current tag v2.0.0-alpha.23)
from stencila.
Thanks Simon. @brettc I wonder if you could look at this and make a PR that improves the docs and/or refines the Python DX.
from stencila.
I had a look over this. I think there are bigger issues about poetry. Here are my first thoughts (looking for feedback).
Poetry is great for developing python projects, but has poor support for extensions. It is currently a bit of a hack.
I have written my own "build.py" script for the c++ extension to deal with this.
In the current setup, this means that poetry does not really know about maturin. A "poetry install" will not work, as it does not call the maturin build. (Actually, it currently just breaks because it does not know where the package is, but that can be fixed).
Possible paths ahead:
- Ignore these issues and just say in the docs you need poetry installed.
- Write a "build.py" script that correctly invokes maturin.
- Get rid of poetry and use some of the newer, standard python building tools.
For 3, I'm thinking we could save ourselves a lot of trouble by looking at the current version of pydantic-core (the rust based support for pydantic 2.0). It has the same layout, uses Makefiles, and has much of the funtionality desired, without using poetry.
Thoughts?
from stencila.
Get rid of poetry and use some of the newer, standard python building tools.
This seems like the right approach (I thought Poetry was the best, maybe it was, but now isn't 😕 ) and yep, copying what the other projects using maturin are doing is a good idea. I think that I started doing that but things seemed over complicated and I went for the simplest approach that would work to get robust release builds:
stencila/.github/workflows/release.yml
Lines 229 to 250 in e35e1ed
But all done quite hastily, and probably easily improved. If you think you can do that reasonably quickly, then go for it. I can show you how to run the workflow on GH Actions (without actually creating a release).
from stencila.
I had another fairly quick look at this issue, some of the alternatives, and at pydantic-core
and agree with this:
For 3, I'm thinking we could save ourselves a lot of trouble by looking at the current version of pydantic-core (the rust based support for pydantic 2.0). It has the same layout, uses Makefiles, and has much of the funtionality desired, without using poetry.
My only ask is that we keep things as simple as possible (But No Simpler ™️ ): acknowledging from the outset that dropping poetry will immediately simplify things.
from stencila.
Further investigation:
- l looked at copying the maturin setup from pydantic-core, which has some similarities.
- It was unclear to me how they pinned their non-dev dependencies (I think there just are not that many). But this is something that I suspect we will want to do, if the python library starts supporting plugins and other niceties.
- Pinning, and especially updating the pinned dependencies, is non-trivial. Poetry (and also PDM) provides solutions to this problem. A simple
pip freeze
does not. - So, for the ease of our futures selves, for now, we are going to stick with poetry, cos it is already there, and it mostly works (I have added one tiny fix that cause poetry install issues in #1851).
- The remaining problem is that you need to manually run maturin because poetry will not do it for you. But the makefile does the right thing.
TLDR: if you are a developer, you need poetry installed. Use the makefile commands to build and test.
We can revisit the building in the future, but I think we should close this issue @nokome
from stencila.
Related Issues (20)
- feat(node-card details): turn details into an inline display
- bug(schema): relaxed types not handled in python
- feat(node-card): components to render inline/block for on-demand and in-flow
- feat(markdown codec): return position-to-node mapping for `from_str`
- feat(lsp): add a Language Server Protocol server HOT 1
- ci(python): fix `make -C python/stencila cover`
- feat(node-card): Rendering issues to address HOT 1
- feat(node-card): collapsing and showing content in a card
- feat(marketing site): Set up a skeleton page
- feat(web view): show detailed information of each block HOT 1
- feat(provenance): display provenance in preview HOT 1
- meta(planning): priorities and ordering of task 7-24 May HOT 3
- fix/static rendering methods
- bug(display of authorship): unwanted gaps within words HOT 1
- fix(document preview): improve display of article level `author` and `provenance` properties
- fix(provenance): use icons for displaying provenance categories
- bug(execution messages): tooltips for messages are shown in serif font
- Rendering / Expanding Node Cards HOT 6
- automate python package publishing
- fix(lsp): fix `TextNode` so that position mapping works reliably
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 stencila.