Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
Update codegen code

wip

wip
  • Loading branch information
mzeitlin11 committed Jul 6, 2024
1 parent ba6f20d commit fd94ab2
Show file tree
Hide file tree
Showing 834 changed files with 77,330 additions and 20,257 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ body:
id: language-version
attributes:
label: Rust version
placeholder: Our MSRV is 1.73.0
placeholder: Our MSRV is 1.75.0
validations:
required: true
- type: input
Expand Down
78 changes: 44 additions & 34 deletions .github/workflows/async-stripe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
RUSTFLAGS: -Dwarnings
rust_min: 1.73
rust_min: 1.75

jobs:
format:
Expand Down Expand Up @@ -74,16 +74,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
features:
[
async-std-surf,
tokio-hyper,
tokio-hyper-rustls,
tokio-hyper-rustls-webpki,
blocking,
blocking-rustls,
blocking-rustls-webpki,
default-tls,
rustls-tls-webpki-roots,
rustls-tls-native,
]

steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -97,21 +94,45 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Run clippy
run: cargo clippy --features "runtime-${{ matrix.runtime }} full serialize deserialize"
run: cargo clippy --no-default-features --features "full serialize deserialize ${{ matrix.features }}"

test-clients:
name: Test Clients
runs-on: ubuntu-latest
strategy:
matrix:
features:
[
default-tls,
rustls-tls-webpki-roots,
rustls-tls-native,
]

steps:
- name: Checkout sources
uses: actions/checkout@v3

test:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_min }}
components: clippy

- uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test --no-default-features --features "full serialize deserialize ${{ matrix.features }}"

stripe-mock-tests:
name: Stripe Mock Tests
runs-on: ubuntu-latest
strategy:
matrix:
runtime:
features:
[
async-std-surf,
tokio-hyper,
tokio-hyper-rustls,
tokio-hyper-rustls-webpki,
blocking,
blocking-rustls,
blocking-rustls-webpki,
default-tls,
rustls-tls-webpki-roots,
rustls-tls-native,
]
services:
stripe-mock:
Expand All @@ -128,20 +149,9 @@ jobs:
toolchain: ${{ env.rust_min }}

- uses: Swatinem/rust-cache@v2
- name: Run stripe mock tests
run: cargo test -p async-stripe-tests --no-default-features --features ${{ matrix.features }}

- uses: taiki-e/install-action@cargo-llvm-cov
- name: Test and gather coverage
run: cargo llvm-cov --lcov --output-path lcov.info --features "runtime-${{ matrix.runtime }} serialize deserialize"
- name: Upload to codecov.io
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
files: lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: lcov.info

docs:
name: Docs
Expand All @@ -155,7 +165,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Build Documentation
run: cargo doc --lib --no-deps --features "runtime-tokio-hyper full"
run: cargo doc --lib --no-deps --features "full serialize deserialize"

# Examples tested separately so that we can use crates which don't match our MSRV
examples:
Expand All @@ -170,4 +180,4 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Check examples
run: cargo clippy --features "runtime-tokio-hyper-rustls" --workspace
run: cargo clippy --workspace
14 changes: 8 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[workspace]
members = [
"async-stripe",
"stripe_types",
"stripe_webhook",
"tests",
"generated/*",
"examples/*",
"stripe_client_core",
"async-stripe",
"stripe_async_std"
]

# Skip "examples/*" when running default commands since that adds a bunch of deps that makes
# development feedback loop slower
default-members = ["async-stripe", "stripe_types", "stripe_webhook", "tests", "generated/*"]
# development feedback loop slower.
default-members = ["async-stripe", "stripe_types", "stripe_webhook", "stripe_client_core", "generated/*", "stripe_async_std"]
resolver = "2"
# Makes dependency management simpler to allow codegen crate to use whichever dep versions
# it wants without affecting dependency resolution of the user-facing library crates
Expand All @@ -19,7 +21,7 @@ exclude = ["openapi"]
[workspace.package]
version = "0.22.2"
description = "API bindings for the Stripe HTTP API"
rust-version = "1.73.0"
rust-version = "1.75.0"
authors = [
"Anna Baldwin <[email protected]>",
"Kevin Stenerson <[email protected]>",
Expand All @@ -37,7 +39,7 @@ edition = "2021"

[workspace.dependencies]
serde = { version = ">=1.0.79", features = ["derive"] } # we use `serde(other)` which was introduced in 1.0.79
serde_json = "1"
http-types = { version = "2.12.0", default-features = false }
smol_str = { version = "0.2.0", features = ["serde"] }
miniserde = "0.1.34"
serde_json = "1.0.115"
serde_qs = "0.12.0"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ If you don't see the specific version you are on, prefer the next available vers

## MSRV

We currently have `1.73.0` pinned in CI, so any version of rustc newer than that should
We currently have `1.75.0` pinned in CI, so any version of rustc newer than that should
work.
If this is not the case, please open an issue. As a policy, we permit MSRV increases in
non-breaking releases.
Expand Down
107 changes: 24 additions & 83 deletions async-stripe/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,106 +1,47 @@
[package]
name = "async-stripe"
version.workspace = true
edition.workspace = true
description.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
readme.workspace = true
homepage.workspace = true
repository.workspace = true
documentation.workspace = true
keywords.workspace = true
categories.workspace = true

[package.metadata.docs.rs]
features = ["runtime-tokio-hyper"]
edition.workspace = true

[lib]
name = "stripe"

[features]
default = ["uuid", "stream"]

stream = []

# runtimes
async = ["futures-util"]
blocking = []

runtime-tokio-hyper = [
"tokio",
"hyper-client",
"hyper-tls",
"async",
]
runtime-tokio-hyper-rustls = [
"tokio",
"hyper-client",
"hyper-rustls",
"hyper-rustls-native",
"async",
]
runtime-tokio-hyper-rustls-webpki = [
"tokio",
"hyper-client",
"hyper-rustls-webpki",
"async",
]
runtime-blocking = [
"tokio",
"tokio/rt",
"hyper-client",
"hyper-tls",
"blocking",
]
runtime-blocking-rustls = [
"tokio",
"tokio/rt",
"hyper-client",
"hyper-rustls-native",
"blocking",
]
runtime-blocking-rustls-webpki = [
"tokio",
"tokio/rt",
"hyper-client",
"hyper-rustls-webpki",
"blocking",
]
runtime-async-std-surf = [
"async-std",
"surf",
"async",
]
[dependencies]
hyper = { version = "0.14.28", default-features = false, features = ["http1", "http2", "client", "tcp"] }
hyper-tls = { version = "0.5", optional = true }
hyper-rustls = { version = "0.24", default-features = false, features = ["http1", "http2", "tls12", "logging"], optional = true }
thiserror = "1.0.58"
miniserde.workspace = true
tokio = { version = "1.24.1", features = ["rt", "macros"] }

# we need the compat crate if using hyper
hyper-client = ["hyper", "http-types/hyperium_http"]
stripe_shared = { path = "../generated/stripe_shared" }
stripe_client_core = { path = "../stripe_client_core" }

hyper-rustls-native = ["hyper-rustls", "hyper-rustls/native-tokio"]
hyper-rustls-webpki = ["hyper-rustls", "hyper-rustls/webpki-tokio"]
[features]
default = ["default-tls"]

[dependencies]
stripe_types = { path = "../stripe_types" }
stripe_shared = { path = "../generated/stripe_shared" }
async-std = { version = "1.8,<1.11", optional = true }
default-tls = ["dep:hyper-tls"]
native-tls = ["default-tls"]
rustls-tls-webpki-roots = ["__rustls", "hyper-rustls/webpki-tokio"]
rustls-tls-native = ["__rustls", "hyper-rustls/native-tokio"]
__rustls = ["dep:hyper-rustls"]

thiserror = "1.0.24"
hyper = { version = "0.14", default-features = false, features = ["http1", "http2", "client", "tcp"], optional = true }
hyper-tls = { version = "0.5", optional = true }
hyper-rustls = { version = "0.24", default-features = false, features = ["http1", "http2", "tls12", "logging"], optional = true }
serde_qs = "0.12.0"
surf = { version = "2.1", optional = true }
tokio = { version = "1.2", optional = true }
uuid = { version = "1.6.1", optional = true, features = ["v4"] }
blocking = []
uuid = ["stripe_client_core/uuid"]

[dev-dependencies]
serde.workspace = true
serde_json.workspace = true
http-types.workspace = true
smol_str.workspace = true
miniserde.workspace = true
httpmock = { version = "0.7.0", default-features = false }

# stream for lists
futures-util = { version = "0.3.21", optional = true }

[dev-dependencies]
httpmock = "0.6.7"
async-std = { version = "1.10.0", features = ["attributes"] }
tokio = { version = "1.24.1", features = ["rt", "macros"] }
23 changes: 0 additions & 23 deletions async-stripe/build.rs

This file was deleted.

Loading

0 comments on commit fd94ab2

Please sign in to comment.