Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Rust and Python APIs #9

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: r7kamura/[email protected]
- run: cargo --version --verbose
- uses: Swatinem/rust-cache@v2
Expand All @@ -39,17 +42,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: r7kamura/[email protected]
- run: cargo --version --verbose

- name: "Clippy"
run: cargo clippy --all --all-features

rustfmt:
name: "Formatting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: r7kamura/[email protected]
- name: "rustfmt"
run: cargo fmt --all -- --check
Expand All @@ -59,7 +68,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: r7kamura/[email protected]
- run: cargo --version --verbose
- uses: Swatinem/rust-cache@v2
Expand All @@ -78,6 +89,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: 3.8
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pip_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path libraries/fastformat/Cargo.toml --all-features
args: --release --out dist --find-interpreter --manifest-path apis/python/Cargo.toml --all-features
sccache: "true"
manylinux: auto
- name: Upload wheels
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path libraries/fastformat/Cargo.toml --all-features
args: --release --out dist --find-interpreter --manifest-path apis/python/Cargo.toml --all-features
sccache: "true"
manylinux: musllinux_1_2
- name: Upload wheels
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
target: ${{ matrix.platform.target }}
manylinux: auto
container: off
args: --release -o dist -i 3.8 --manifest-path libraries/fastformat/Cargo.toml --all-features
args: --release -o dist -i 3.8 --manifest-path apis/python/Cargo.toml --all-features
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -134,7 +134,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path libraries/fastformat/Cargo.toml --all-features
args: --release --out dist --find-interpreter --manifest-path apis/python/Cargo.toml --all-features
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -160,7 +160,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path libraries/fastformat/Cargo.toml --all-features
args: --release --out dist --find-interpreter --manifest-path apis/python/Cargo.toml --all-features
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -176,7 +176,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path libraries/fastformat/Cargo.toml
args: --out dist --manifest-path apis/python/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ jobs:
- name: "Publish packages on `crates.io`"
if: runner.os == 'Linux'
run: |

# Publish libraries crates
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
cargo publish -p fastformat --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ dora-coordinator.txt
dora-daemon.txt

out/

pyrightconfig.json
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# How to contribute to `fastformat`

We welcome bug reports, feature requests, and pull requests!

Please discuss non-trivial changes in a Github issue or on Discord first before implementing them.
This way, we can avoid unnecessary work on both sides.

## Building

The `fastformat` project is set up as a [cargo workspace](https://doc.rust-lang.org/cargo/reference/workspaces.html).
You can use the standard `cargo check`, `cargo build`, `cargo run`, and `cargo test` commands.
To run a command for a specific package only, pass e.g. `--package fastformat-datatypes`.
Running a command for the whole workspace is possible by passing `--workspace`.

## Continuous Integration (CI)

We're using [GitHub Actions](https://github.com/features/actions) to run automated checks on all commits and pull requests.
These checks ensure that our `main` branch always builds successfully and that it passes all tests.
Please ensure that your pull request passes all checks.
You don't need to fix warnings that are unrelated to your changes.
Feel free to ask for help if you're unsure about a check failure.

We're currently running the following kind of checks:

- **CI / Test:** Ensures that the project builds and that all unit tests pass. This check is run on Linux, Windows, and macOS.
- **CI / Clippy:** Runs the additional checks of the [`clippy`](https://github.com/rust-lang/rust-clippy) project.
- **CI / Formatting:** Ensures that the code is formatted using `rustfmt` (see [below](#style))
- **CI / License Checks:** Scans the dependency tree and tries to detect possible license incompatibilities.

## Style

We use [`rustfmt`](https://github.com/rust-lang/rustfmt) with its default settings to format our code.
Please run `cargo fmt --all` on your code before submitting a pull request.
Our CI will run an automatic formatting check of your code.

## Publishing new Versions

The maintainers are responsible for publishing new versions of the `fastformat` crates.
Please don't open unsolicited pull requests to create new releases.
Instead, request a new version by opening an issue or by leaving a comment on a merged PR.
Loading
Loading