Skip to content

Commit

Permalink
Merge pull request #8 from Decompollaborate/develop
Browse files Browse the repository at this point in the history
1.2.1
  • Loading branch information
AngheloAlf authored Dec 15, 2024
2 parents 96967a9 + df56b2a commit 099627f
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maturin_upload_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.13'

- name: Build wheels
uses: PyO3/maturin-action@v1
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.13'
architecture: ${{ matrix.target }}

- name: Build wheels
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.13'

- name: Build wheels
uses: PyO3/maturin-action@v1
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,23 @@ jobs:
runs-on: ubuntu-latest
name: mypy
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Dependencies
run: |
pip3 install -U mypy
- name: Setup venv
run: |
python3 -m venv .venv
. .venv/bin/activate
- name: mypy
run: mypy --show-column-numbers --hide-error-context .
- name: Install dependencies
run: |
python3 -m pip install -U mypy
- name: mypy
run: |
python3 -m mypy --show-column-numbers --hide-error-context .
14 changes: 14 additions & 0 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ jobs:
- name: Run tests
run: cargo test --workspace

msrv:
runs-on: ubuntu-latest
steps:
- name: Checkout reposistory
uses: actions/checkout@v4

- name: Setup MSRV checker
uses: taiki-e/install-action@cargo-hack

# To find current MSRV use `cargo msrv find`. Install it with `cargo install cargo-msrv --locked`
- name: Run MSRV checker
run: cargo hack check --rust-version --workspace --all-targets --ignore-private


publish:
name: Publish
runs-on: ubuntu-latest
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.1] - 2024-12-15

### Added

- Prebuilt binaries for Python 3.13.

### Changed

- Set MSRV (minimum supported Rust version) to 1.60.
- Python 3.9 or later is now required.
- Bump from Python 3.7 to 3.9.
- Older versions can't be checked on CI anymore, so I prefer to not claim to
support something that may have broken without anybody noticing.
- Nothing really changed. Just the CI tools I was using are refusing to use
any Python version older than this. Sorry if you were affected by this.

### Fixed

- Fix some typos

## [1.2.0] - 2024-01-11

### Added
Expand Down Expand Up @@ -78,6 +98,7 @@ version of the library.
- Initial relase

[unreleased]: https://github.com/Decompollaborate/ipl3checksum/compare/main...develop
[1.2.1]: https://github.com/Decompollaborate/ipl3checksum/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/Decompollaborate/ipl3checksum/compare/1.1.1...1.2.0
[1.1.1]: https://github.com/Decompollaborate/ipl3checksum/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/Decompollaborate/ipl3checksum/compare/1.0.1...1.1.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
[package]
name = "ipl3checksum"
# Version should be synced with src/ipl3checksum/__init__.py, pyproject.toml and src/rs/version.rs
version = "1.2.0"
version = "1.2.1"
edition = "2021"
description = "Library to calculate the IPL3 checksum for N64 ROMs"
repository = "https://github.com/decompollaborate/ipl3checksum"
license = "MIT"
rust-version = "1.60.0"

[lib]
name = "ipl3checksum"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ If you use a `requirements.txt` file in your repository, then you can add
this library with the following line:

```txt
ipl3checksum>=1.1.0,<2.0.0
``````
ipl3checksum>=1.2.1,<2.0.0
```

Now you can invoke the library from your script.

Expand Down Expand Up @@ -124,7 +124,7 @@ cargo add ipl3checksum
Or add the following line manually to your `Cargo.toml` file:

```toml
ipl3checksum = "1.1.0"
ipl3checksum = "1.2.1"
```

### C bindings
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[mypy]
python_version = 3.7
python_version = 3.9
check_untyped_defs = True
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[project]
name = "ipl3checksum"
# Version should be synced with src/ipl3checksum/__init__.py, Cargo.toml and src/rs/version.rs
version = "1.2.0"
version = "1.2.1"
description = "Library to calculate the IPL3 checksum for N64 ROMs"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.9"
license = {file = "LICENSE"}
keywords = ["IPL3", "CIC", "checksum", "N64", "Nintendo 64"]
authors = [
Expand Down
2 changes: 1 addition & 1 deletion src/ipl3checksum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import annotations

# Version should be synced with pyproject.toml, Cargo.toml and src/rs/version.rs
__version_info__: tuple[int, int, int] = (1, 2, 0)
__version_info__: tuple[int, int, int] = (1, 2, 1)
__version__ = ".".join(map(str, __version_info__))
__author__ = "Decompollaborate"

Expand Down
6 changes: 3 additions & 3 deletions src/ipl3checksum/frontends/sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ def processArguments(args: argparse.Namespace):
exit(doSum(romBytes, kindName, update, outputPath))

def addSubparser(subparser: argparse._SubParsersAction[argparse.ArgumentParser]):
parser = subparser.add_parser("sum", help="Calculates the ipl3 checksum of a big endian ROM by detecting the CIC it uses.")
parser = subparser.add_parser("sum", help="Calculates the ipl3 checksum of a big endian ROM by detecting the CIC it uses and optionally update it.")

parser.add_argument("rom_path", help="Path to a big endian ROM file", type=Path)

parser.add_argument("-k", "-c", "--kind", "--cic", help="Used this variant to calculate the checksum instead of automatically detecting which kind the ROM uses", dest="kind", metavar="KIND", choices=ipl3checksum.CICKind.validNames())
parser.add_argument("-u", "--update", help="Updates the ROM with the calculated checksum. This option modified the input rom unless `--output` is used", action="store_true")
parser.add_argument("-k", "-c", "--kind", "--cic", help="Use this variant to calculate the checksum instead of automatically detecting which kind the ROM uses", dest="kind", metavar="KIND", choices=ipl3checksum.CICKind.validNames())
parser.add_argument("-u", "--update", help="Updates the ROM with the calculated checksum. This option modifies the input rom unless `--output` is used", action="store_true")
parser.add_argument("-o", "--output", help="Path to write the updated ROM. This option is ignored if `--update` is not used", type=Path)

parser.set_defaults(func=processArguments)
2 changes: 1 addition & 1 deletion src/rs/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ mod tests {

println!(" Reading...");

let bin_bytes = fs::read(&bin_path.path()).unwrap();
let bin_bytes = fs::read(bin_path.path()).unwrap();

println!(" Calculating checksum...");
let checksum = super::calculate_checksum(&bin_bytes, kind).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/rs/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// Version should be synced with pyproject.toml, Cargo.toml and src/ipl3checksum/__init__.py
pub static VERSION_MAJOR: i32 = 1;
pub static VERSION_MINOR: i32 = 2;
pub static VERSION_PATCH: i32 = 0;
pub static VERSION_PATCH: i32 = 1;

pub static VERSION_INFO: (i32, i32, i32) = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);

// TODO: figure out a way to construct this string by using VERSION_MAJOR, VERSION_MINOR and VERSION_PATCH (concat! and stringify! didn't work)
pub static VERSION_STR: &str = "1.2.0";
pub static VERSION_STR: &str = "1.2.1";

pub static AUTHOR: &str = "Decompollaborate";

Expand All @@ -24,7 +24,7 @@ mod c_bindings {

// TODO: construct this from super::VERSION_STR
#[no_mangle]
static ipl3checksum_version_str: &[u8] = b"1.2.0\0";
static ipl3checksum_version_str: &[u8] = b"1.2.1\0";

// TODO: construct this from super::AUTHOR
#[no_mangle]
Expand Down

0 comments on commit 099627f

Please sign in to comment.