Open illya-laifu opened 2 months ago
That's fantastic! And, I think this approach looks good: interfacing directly from Python into the taskchampion
crate. The taskchampion-lib
crate was a bit of a mistake (soon to be replaced with use of CXX from Taskwarrior), so I'm glad you didn't choose to use that.
A few questions toward finding a way to make progress here;
Maybe a good next step is to get something that works into a PR and get that merged, with multiple TODO's scattered about. That can include README describing the intended implementation, and indicating that it's not yet stable or ready for use. Then we can get a few more issues filed and perhaps a few people can work on separate aspects in parallel.
To answer your questions:
taskchampion_lib
crate as an inspiration, plus a healthy dose of docs from the pyo3. However, there are a number of crates that do could be used as an example, like tokenizerstokenizers
put all their bindings in a single subfolder called bindings
, but it is possible to do this standalone as well. Packaging is done via the same tool used to instantiate and build the project - maturin
. On build
is builds a wheel package, that can be uploaded to pypi via maturin publish
, or by using other publishing tools.As per your suggestion, I will continue work in the forked repository, so we can possibly PR. This can be pulled into its own, separate repository later on, if need arises.
Sounds good!
Ok, I think I have the the core. I'll create PR in a bit, documenting the install/test process.
Annotation
class and the getters/setters for the two fields.Replica
class (::dependency_map
method needs more testing and polishing due to the Rc
reference)Status
enumTag
classTask
class *WorkingSet
classDependencyMap
classStorage
concrete classes.InMemoryStorage
, SqliteStorage
or users own implementation of Storage
)Task
class is the immutable version of it, it would be nice to extend it to also include the methods from TaskMut
and convert to and the mutable state in those method calls. It is impossible to implement the TaskMut
via pyo3 due to the lifetime parameters.*next()
and with for item in ws:
, but this needs it to hold the reference to an iterator.uuid
library, currently the methods that accept a UUID, do that by accepting str
and converting it into the rust's implementation of UUID
. This is really cool! I will try to take a look, but I've been quite busy so I invite anyone else following along to also jump in and offer feedback.
Quick update on the todo items -- adding signature stub files is quite simple, just a bit tedious.
Hello,
Really appreciate your work on taskwarrior/taskchampion!
With the release of a new way to interact with the app (via the rust library), python bindings are needed. It's a big request, so I come bearing gifts - a fork with a POC barebones attempt to connect with an existing database instance and task creation here.
It's very much a barebones POC, with two methods, to get the impression of the workload needed; right now the code lives in the
py-lib
directory, and can be assembled via maturin.Here's the demo in python console as an easy test:![Screenshot_20240504_160351](https://github.com/GothenburgBitFactory/taskchampion/assets/110652325/145da57f-08d2-4f45-b766-ca2b1694f153)
Guess I am volunteering to work on this?