iliana / rust-crowbar

Wrapper to simplify writing AWS Lambda functions in Rust (using the Python execution environment)
https://docs.rs/crowbar
Apache License 2.0
197 stars 16 forks source link

re-export cpython (macros) #45

Open softprops opened 5 years ago

softprops commented 5 years ago

This relates to some UX improvements I've ran into in a crate build on top of crowbar called lando https://github.com/softprops/lando/pull/24. In essence the UX issue was the requirement for end users to explicitly add a dependency on cpython in their Cargo.toml file and macro_use in their lib.rs files as an artifact of an implementation detail that crowbar ( and lando ) where invoking cpython macros.

Implementation details like that should have an externally visible cost on configuration for end users.

The approach lando took was to re-export cpython crate and its top level items with a doc hidden declaration. The net effect was removing the requirement of users to have to explicitly depend on this both in their cargo config as well as their source code.

I think it's worth, also for the sake of end user UX to apply a similar tactic for crowbar.

Some extra bits of information that may make this a more unique case for crowbar than it did for lando.

softprops commented 5 years ago

Revisiting the unique cases details now after some time I want to identify if some of working convention pieces are still needed. I notice now that I down graded cpython from 0.2 to 0.1. Both 0.2 0.1 already set a default feature flag for python3-sys as does crowbar so that may actually be a non issue for me and I can go and remove that cruft today! ( I'll check back when I verify that )

I don't see anything notably different between the associated version of python-sys 0.1.3 and 0.2.0 that would require a cpython downgrade.

In any case I wanted to document here the docker image I've been using to build my crowbar artifacts.

softprops commented 5 years ago

Now I see why I feel scatter brained about versions here when looking at the latest src. It's because these just changed 14 hours ago :)

softprops commented 5 years ago

It looks like those haven't made their way to crates.io yet so Im going to experiment a bit more with the versions I have. Before commuting to changes. It would be great to get those released to crates.io so I can start updating and testing my templates

iliana commented 5 years ago

It's because these just changed 14 hours ago :)

oops yeah :sweat_smile:

softprops commented 5 years ago

No worries. I thought I was just having a moment there :)