This repository was archived by the owner on Mar 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Adding support for RDB version <= 12 and refactoring #19
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
4d52810
Add new rdb version and datatypes
bimtauer 865bea2
Begin port to clap and revised structure
bimtauer 677b503
Refactor, fix previous test, add rust integration test
bimtauer 40bea25
Introduce file output and simplify integration test
bimtauer a28198f
Change encoding of non ascii chars
bimtauer 7b06391
Implement hash list pack
bimtauer 4decc7b
Begin factoring out formatter from parser
bimtauer 3e25fe5
Further refactor formatter
bimtauer 2d11517
Fix tests for refactored json formatter, cleanup pending
bimtauer 0633c9e
Refactor formatter, generic format method
bimtauer 7aaf4ea
Implement skip for hash list pack
bimtauer 8083786
Add integration tests for plain and protocol format
bimtauer f5c159b
Improve error handling
bimtauer 036be25
Create protocol based integration test across versions
bimtauer e4bf3c2
Implement listpack handling, better errors, ensure that all previousl…
bimtauer 0439a7b
Implement sorted set v2 and listpack encodings
bimtauer 3115477
Add logging
bimtauer c0424ae
Small cleanup
bimtauer b16a169
Restructure code and public lib interface
bimtauer ca0cd68
Add python bindings
bimtauer bac656d
Update readme
bimtauer 419a88c
Update changelog
bimtauer ead9e1a
Link changelog
bimtauer b7bcbb5
Fix start and end formatting
bimtauer fcdf100
Integrate shell script tests fully into rust integration tests
bimtauer 8152adf
Remove makefile
bimtauer 74b5836
Update ignore and rm python version
bimtauer 361a432
Heed clippy's call
bimtauer 279fce9
Add Rust CI workflow
bimtauer 7a5bfac
Clean
bimtauer cd8a83a
Fix Redis Container Integration Test
bimtauer 817f9b4
Adapt python CI
bimtauer ef4608a
Prep release
bimtauer 2ce44ab
Removing token should use trusted publisher
bimtauer 2a87c62
Rename python project
bimtauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @bimtauer | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# This file is autogenerated by maturin v1.8.1 | ||
# To update, run | ||
# | ||
# maturin generate-ci github --platform linux --platform windows --platform macos | ||
# | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
- '*' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
linux: | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: ubuntu-22.04 | ||
target: x86_64 | ||
- runner: ubuntu-22.04 | ||
target: x86 | ||
- runner: ubuntu-22.04 | ||
target: aarch64 | ||
- runner: ubuntu-22.04 | ||
target: armv7 | ||
- runner: ubuntu-22.04 | ||
target: s390x | ||
- runner: ubuntu-22.04 | ||
target: ppc64le | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.platform.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
manylinux: auto | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-linux-${{ matrix.platform.target }} | ||
path: dist | ||
|
||
windows: | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: windows-latest | ||
target: x64 | ||
- runner: windows-latest | ||
target: x86 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
architecture: ${{ matrix.platform.target }} | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.platform.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-windows-${{ matrix.platform.target }} | ||
path: dist | ||
|
||
macos: | ||
runs-on: ${{ matrix.platform.runner }} | ||
strategy: | ||
matrix: | ||
platform: | ||
- runner: macos-13 | ||
target: x86_64 | ||
- runner: macos-14 | ||
target: aarch64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.platform.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-macos-${{ matrix.platform.target }} | ||
path: dist | ||
|
||
sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build sdist | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: sdist | ||
args: --out dist | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-sdist | ||
path: dist | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} | ||
needs: [linux, windows, macos, sdist] | ||
permissions: | ||
# Use to sign the release artifacts | ||
id-token: write | ||
# Used to upload release artifacts | ||
contents: write | ||
# Used to generate artifact attestation | ||
attestations: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-path: 'wheels-*/*' | ||
- name: Publish to PyPI | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: upload | ||
args: --non-interactive --skip-existing wheels-*/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will fail in this repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Cargo Build & Test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build_and_test: | ||
name: Rust project - latest | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
toolchain: | ||
- stable | ||
- beta | ||
- nightly | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup toolchain | ||
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | ||
|
||
- name: Cache cargo | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: cargo build | ||
run: cargo build --verbose | ||
|
||
- name: cargo test | ||
run: cargo test --verbose | ||
|
||
- name: Check formatting | ||
if: matrix.toolchain == 'stable' | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Clippy | ||
if: matrix.toolchain == 'stable' | ||
run: cargo clippy --all --all-features --tests -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
/target | ||
/Cargo.lock | ||
/utils/pkg | ||
/utils/src | ||
/utils/rdb-rs | ||
*.tar.gz | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
badboy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
# Python | ||
.python-version |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
[package] | ||
|
||
name = "rdb" | ||
version = "0.2.1" | ||
authors = ["Jan-Erik Rediger <[email protected]>"] | ||
|
||
keywords = ["redis", "database"] | ||
edition = "2021" | ||
version = "0.3.0" | ||
authors = ["Jan-Erik Rediger <[email protected]>", "Tim Bauer <[email protected]>"] | ||
keywords = ["redis", "database", "rdb", "parser"] | ||
description = "Fast and efficient RDB parsing utility" | ||
|
||
readme = "README.md" | ||
license = "MIT" | ||
|
||
homepage = "http://rdb.fnordig.de/" | ||
documentation = "http://rdb.fnordig.de/doc/rdb/" | ||
repository = "https://github.com/badboy/rdb-rs" | ||
|
@@ -28,9 +25,33 @@ name = "rdb" | |
path = "src/main.rs" | ||
doc = false | ||
|
||
[lib] | ||
name = "rdb" | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[dependencies] | ||
lzf = "0.3" | ||
getopts = "0.2" | ||
rustc-serialize = "0.3" | ||
regex = "0.1" | ||
byteorder = "0.5" | ||
thiserror = "1.0" | ||
pyo3 = { version = "0.23.3", features = ["extension-module"], optional = true } | ||
clap = { version = "4.4", features = ["derive"] } | ||
indexmap = "2.7.0" | ||
log = "0.4.22" | ||
|
||
[dev-dependencies] | ||
async-std = { version = "1.13.0", features = ["attributes"] } | ||
tokio = { version = "1.0", features = ["full"] } | ||
pretty_assertions = "1.4.1" | ||
redis = "0.27.6" | ||
rstest = "0.23.0" | ||
testcontainers = "0.23.1" | ||
testcontainers-modules = { version = "0.11.4", features = ["redis"] } | ||
tempfile = "3.14.0" | ||
assert_cmd = "2.0.16" | ||
|
||
[features] | ||
default = [] | ||
python = ["pyo3"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this in my fork as a precaution against hijacking since I did test-publish the python package rdb-py from there. I used a trusted publisher configured for my fork for this. Publishing the python bindings wont work from here. Let me know if you also want to publish 0.3 of the python lib from here first.
Sorry for not mentioning this ealier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good! Once I publish the latest version on crates.io, I will hand it over to you and your repo becomes the main one. So we can keep it as that and you can do the rdb-py release afterwards.