diff --git a/.github/workflows/crates.yml b/.github/workflows/crates.yml new file mode 100644 index 000000000..935ce2aba --- /dev/null +++ b/.github/workflows/crates.yml @@ -0,0 +1,28 @@ +name: Deploy Crates + +on: + push: + tags: + - "*" + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install and configure Poetry + uses: snok/install-poetry@v1 + - name: Install task runner + run: pip install poethepoet + - name: Bump versions + run: | + poetry install --only version + poe bump-version + - name: Publish crates + run: | + jq '.[]' crates/release.json | xargs -I _ cargo publish -p _ --allow-dirty + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/maturin.yml b/.github/workflows/maturin.yml new file mode 100644 index 000000000..4680d0316 --- /dev/null +++ b/.github/workflows/maturin.yml @@ -0,0 +1,123 @@ +name: Deploy Maturin wheels + +on: + push: + tags: + - "*" + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter -m crates/eko/Cargo.toml + 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.10" + architecture: ${{ matrix.platform.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter -m crates/eko/Cargo.toml + 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-latest + target: x86_64 + - runner: macos-14 + target: aarch64 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter -m crates/eko/Cargo.toml + 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 -m crates/eko/Cargo.toml + - 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/')" + needs: [linux, windows, macos, sdist] + steps: + - uses: actions/download-artifact@v4 + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing wheels-*/* diff --git a/.github/workflows/unittests-rust.yml b/.github/workflows/unittests-rust.yml index 9cce3048d..2b05cb4d6 100644 --- a/.github/workflows/unittests-rust.yml +++ b/.github/workflows/unittests-rust.yml @@ -3,13 +3,19 @@ name: Rust unit tests on: push jobs: - test-rust: + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - name: Install task runner run: pip install poethepoet + - name: Run fmt + run: | + poe fmtcheck + - name: Run clippy + run: | + poe clippy - name: Run Rust unit tests run: | poe rtest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a799f3f3..718cfe85d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks ci: autofix_prs: false - skip: [fmt-eko, fmt-ekore] + skip: [fmt] # will be run by a separate CI repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -45,21 +45,12 @@ repos: - toml - repo: local hooks: - - id: fmt-eko - name: fmt-eko - description: Format eko files with cargo fmt. - entry: cargo fmt --manifest-path crates/eko/Cargo.toml -- + - id: fmt + name: fmt + description: Format Rust files with cargo fmt. + entry: cargo fmt -- language: system - files: ^crates/eko/.*\.rs$ - args: [] - - repo: local - hooks: - - id: fmt-ekore - name: fmt-ekore - description: Format ekore files with cargo fmt. - entry: cargo fmt --manifest-path crates/ekore/Cargo.toml -- - language: system - files: ^crates/ekore/.*\.rs$ + files: ^crates/.*\.rs$ args: [] - repo: https://github.com/pre-commit/pre-commit rev: v3.7.1 diff --git a/crates/Cargo.lock b/Cargo.lock similarity index 99% rename from crates/Cargo.lock rename to Cargo.lock index 0e6acc14f..80fa02400 100644 --- a/crates/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "eko" -version = "0.1.0" +version = "0.0.1" dependencies = [ "ekore", "num", @@ -41,7 +41,7 @@ dependencies = [ [[package]] name = "ekore" -version = "0.1.0" +version = "0.0.1" dependencies = [ "float-cmp", "hashbrown", diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..f26518890 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,22 @@ +[workspace] +members = ["crates/*"] +resolver = "2" + +[workspace.package] +authors = [ + "A. Barontini ", + "A. Candido ", + "F. Hekhorn ", + "N. Laurenti ", + "G. Magni ", + "T. Sharma ", +] +description = "Evolution Kernel Operators" +readme = "README.md" +categories = ["science"] +edition = "2021" +keywords = ["physics"] +license = "GPL-3.0-or-later" +repository = "https://github.com/NNPDF/eko" +rust-version = "1.60.0" +version = "0.0.1" diff --git a/crates/Cargo.toml b/crates/Cargo.toml deleted file mode 100644 index 8a69f7202..000000000 --- a/crates/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[workspace] - -members = ["eko", "ekore"] diff --git a/crates/README.md b/crates/README.md new file mode 100644 index 000000000..baa27a087 --- /dev/null +++ b/crates/README.md @@ -0,0 +1,18 @@ +# Welcome to the rusty side of EKO! + +Here, we develop the Rust components of the EKO library + +## Crates + +- `ekore` contains the underlying collinear anomalous dimensions and the operator matrix elements +- `eko` is the glue between the Python side and the `ekore` crate + +## Files + +- `release.json` defines the releasing order of crates + - only listed crates will be released + - dependent crates should follow those they are depending on +- `katex-header.html` is an HTML snippet to be included in every docs page to inject + KaTeX support +- `bump-versions.py` increases the Rust versions in all crates consistently +- `make_bib.py` generates the Rust function stubs which serve as fake bibliography system diff --git a/crates/bump-versions.py b/crates/bump-versions.py new file mode 100644 index 000000000..6b7220f7e --- /dev/null +++ b/crates/bump-versions.py @@ -0,0 +1,40 @@ +import json +import sys +from pathlib import Path + +import tomlkit + +HERE = Path(__file__).parent +CRATES = json.loads((HERE / "release.json").read_text()) + + +def workspace(manifest, version): + manifest["workspace"]["package"]["version"] = version + return manifest + + +def crate(manifest, version): + internals = set(manifest["dependencies"].keys()).intersection(CRATES) + for dep in internals: + manifest["dependencies"][dep]["version"] = version + return manifest + + +def update(path, version, edit): + path = HERE / Path(path) / "Cargo.toml" + manifest = tomlkit.parse(path.read_text()) + manifest = edit(manifest, version) + path.write_text(tomlkit.dumps(manifest)) + + +def main(version): + update("..", version, workspace) + for name in CRATES: + update(name, version, crate) + + +if __name__ == "__main__": + if len(sys.argv) < 2: + raise ValueError(f"Pass a version (e.g. v0.0.0) to {sys.argv[0]}") + # `git describe` starts with a `v` which we need to remove again + main(sys.argv[1][1:]) diff --git a/crates/eko/Cargo.toml b/crates/eko/Cargo.toml index 731e1399c..0fc9b2ee7 100644 --- a/crates/eko/Cargo.toml +++ b/crates/eko/Cargo.toml @@ -1,10 +1,19 @@ [package] name = "eko" -version = "0.1.0" -edition = "2021" + +authors.workspace = true +description.workspace = true +readme.workspace = true +categories.workspace = true +edition.workspace = true +keywords.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] -rustdoc-args = [ "--html-in-header", "../katex-header.html" ] +rustdoc-args = ["--html-in-header", "katex-header.html"] [lib] name = "ekors" @@ -12,4 +21,4 @@ crate-type = ["cdylib"] [dependencies] num = "0.4.1" -ekore = { version = "0.1.0", path = "../ekore" } +ekore = { path = "../ekore", version = "0.0.1" } diff --git a/crates/eko/katex-header.html b/crates/eko/katex-header.html new file mode 120000 index 000000000..810e68dcb --- /dev/null +++ b/crates/eko/katex-header.html @@ -0,0 +1 @@ +../katex-header.html \ No newline at end of file diff --git a/crates/eko/pyproject.toml b/crates/eko/pyproject.toml index cd5c25d40..7b2921e04 100644 --- a/crates/eko/pyproject.toml +++ b/crates/eko/pyproject.toml @@ -3,7 +3,7 @@ requires = ["maturin>=1.1,<2.0"] build-backend = "maturin" [project] -name = "ekors" +name = "eko-rs" requires-python = ">=3.9" classifiers = [ "Programming Language :: Rust", diff --git a/crates/eko/src/lib.rs b/crates/eko/src/lib.rs index e6c1229a6..67bf8956a 100644 --- a/crates/eko/src/lib.rs +++ b/crates/eko/src/lib.rs @@ -1,6 +1,5 @@ //! Interface to the eko Python package. -use ekore; use ekore::harmonics::cache::Cache; use std::ffi::c_void; @@ -8,6 +7,9 @@ pub mod bib; pub mod mellin; /// QCD intergration kernel inside quad. +/// +/// # Safety +/// This is the connection from Python, so we don't know what is on the other side. #[no_mangle] pub unsafe extern "C" fn rust_quad_ker_qcd(u: f64, rargs: *mut c_void) -> f64 { let args = *(rargs as *mut QuadQCDargs); @@ -24,11 +26,11 @@ pub unsafe extern "C" fn rust_quad_ker_qcd(u: f64, rargs: *mut c_void) -> f64 { &mut c, args.nf, ); - for k in 0..args.order_qcd { - for l in 0..2 { - for m in 0..2 { - re.push(res[k][l][m].re); - im.push(res[k][l][m].im); + for gamma_s in res.iter().take(args.order_qcd) { + for col in gamma_s.iter().take(2) { + for el in col.iter().take(2) { + re.push(el.re); + im.push(el.im); } } } @@ -39,9 +41,9 @@ pub unsafe extern "C" fn rust_quad_ker_qcd(u: f64, rargs: *mut c_void) -> f64 { &mut c, args.nf, ); - for j in 0..args.order_qcd { - re.push(res[j].re); - im.push(res[j].im); + for el in res.iter().take(args.order_qcd) { + re.push(el.re); + im.push(el.im); } } // pass on @@ -128,7 +130,10 @@ pub struct QuadQCDargs { pub is_threshold: bool, } -/// empty placeholder function for python callback +/// Empty placeholder function for python callback. +/// +/// # Safety +/// This is the connection back to Python, so we don't know what is on the other side. pub unsafe extern "C" fn my_py( _re_gamma: *const f64, _im_gamma: *const f64, @@ -162,6 +167,9 @@ pub unsafe extern "C" fn my_py( /// /// This is required to make the arguments part of the API, otherwise it won't be added to the compiled /// package (since it does not appear in the signature of `quad_ker_qcd`). +/// +/// # Safety +/// This is the connection from and back to Python, so we don't know what is on the other side. #[no_mangle] pub unsafe extern "C" fn empty_qcd_args() -> QuadQCDargs { QuadQCDargs { diff --git a/crates/ekore/Cargo.toml b/crates/ekore/Cargo.toml index 9dfdb7515..86e9784eb 100644 --- a/crates/ekore/Cargo.toml +++ b/crates/ekore/Cargo.toml @@ -1,12 +1,19 @@ [package] name = "ekore" -version = "0.1.0" -edition = "2021" description = "EKO expressions" -license = "GPL-3.0-or-later" + +authors.workspace = true +readme.workspace = true +categories.workspace = true +edition.workspace = true +keywords.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true [package.metadata.docs.rs] -rustdoc-args = [ "--html-in-header", "../katex-header.html" ] +rustdoc-args = ["--html-in-header", "katex-header.html"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/ekore/katex-header.html b/crates/ekore/katex-header.html new file mode 120000 index 000000000..810e68dcb --- /dev/null +++ b/crates/ekore/katex-header.html @@ -0,0 +1 @@ +../katex-header.html \ No newline at end of file diff --git a/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as3.rs b/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as3.rs index b43608e01..14354f736 100644 --- a/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as3.rs +++ b/crates/ekore/src/anomalous_dimensions/unpolarized/spacelike/as3.rs @@ -155,8 +155,7 @@ pub fn gamma_nsv(c: &mut Cache, nf: u8) -> Complex { + 46.18 * E2 ); - let result = gamma_nsm(c, nf) + (nf as f64) * ps2; - result + gamma_nsm(c, nf) + (nf as f64) * ps2 } /// Compute the pure-singlet quark-quark anomalous dimension. diff --git a/crates/ekore/src/bib.rs b/crates/ekore/src/bib.rs index 167294b41..75da707bb 100644 --- a/crates/ekore/src/bib.rs +++ b/crates/ekore/src/bib.rs @@ -1,5 +1,6 @@ -//! List of References (autogenerated on 2024-04-25T18:22:43.797877). +//! List of References (autogenerated on 2024-05-30T12:57:15.459698). +#[allow(non_snake_case)] /// The Three loop splitting functions in QCD: The Nonsinglet case /// /// Moch, S. and Vermaseren, J. A. M. and Vogt, A. @@ -11,6 +12,7 @@ /// DOI: [10.1016/j.nuclphysb.2004.03.030](https:dx.doi.org/10.1016/j.nuclphysb.2004.03.030) pub fn Moch2004pa() {} +#[allow(non_snake_case)] /// The Three-loop splitting functions in QCD: The Singlet case /// /// Vogt, A. and Moch, S. and Vermaseren, J. A. M. @@ -22,6 +24,7 @@ pub fn Moch2004pa() {} /// DOI: [10.1016/j.nuclphysb.2004.04.024](https:dx.doi.org/10.1016/j.nuclphysb.2004.04.024) pub fn Vogt2004mw() {} +#[allow(non_snake_case)] /// Programs for computing the logarithm of the gamma function, and the digamma function, for complex argument /// /// K.S. Kölbig @@ -33,6 +36,7 @@ pub fn Vogt2004mw() {} /// DOI: [https://doi.org/10.1016/0010-4655(72)90012-4](https://doi.org/10.1016/0010-4655(72)90012-4) pub fn KOLBIG1972221() {} +#[allow(non_snake_case)] /// Multi‐precision Laplace transform inversion /// /// Abate, J. and Valkó, P. @@ -44,6 +48,7 @@ pub fn KOLBIG1972221() {} /// DOI: [10.1002/nme.995](https:dx.doi.org/10.1002/nme.995) pub fn Abate() {} +#[allow(non_snake_case)] /// Resummations of Transverse Momentum Distributions /// /// Muselli, Claudio @@ -55,6 +60,7 @@ pub fn Abate() {} /// DOI: [10.13130/muselli-claudio_phd2017-12-01](https:dx.doi.org/10.13130/muselli-claudio_phd2017-12-01) pub fn MuselliPhD() {} +#[allow(non_snake_case)] /// Efficient evolution of unpolarized and polarized parton distributions with QCD-PEGASUS /// /// Vogt, A. diff --git a/crates/ekore/src/harmonics/cache.rs b/crates/ekore/src/harmonics/cache.rs index 88884590f..1342f5175 100644 --- a/crates/ekore/src/harmonics/cache.rs +++ b/crates/ekore/src/harmonics/cache.rs @@ -53,8 +53,8 @@ impl Cache { pub fn get(&mut self, k: K) -> Complex { let val = self.m.get(&k); // already there? - if val.is_some() { - return *val.unwrap(); + if let Some(value) = val { + return *value; } // compute new let val = match k { @@ -87,7 +87,7 @@ pub fn recursive_harmonic_sum( ) -> Complex { let mut fact = Complex::zero(); for i in 1..iterations + 1 { - fact = fact + (1.0 / (n + (i as f64))).powu(weight); + fact += (1.0 / (n + (i as f64))).powu(weight); } base_value + fact } diff --git a/crates/ekore/src/harmonics/g_functions.rs b/crates/ekore/src/harmonics/g_functions.rs index ff0f8789f..cfde9e9ea 100644 --- a/crates/ekore/src/harmonics/g_functions.rs +++ b/crates/ekore/src/harmonics/g_functions.rs @@ -18,7 +18,7 @@ pub fn g3(N: Complex, S1: Complex) -> Complex { let mut g3 = Complex::zero(); for cit in CS.iter().enumerate() { let Nj = N + (cit.0 as f64); - g3 = g3 + (*cit.1) * (ZETA2 - s(S1, N, cit.0, 1) / Nj) / Nj; + g3 += (*cit.1) * (ZETA2 - s(S1, N, cit.0, 1) / Nj) / Nj; } g3 } diff --git a/crates/ekore/src/harmonics/polygamma.rs b/crates/ekore/src/harmonics/polygamma.rs index 6f3d7d66d..7415db88e 100644 --- a/crates/ekore/src/harmonics/polygamma.rs +++ b/crates/ekore/src/harmonics/polygamma.rs @@ -3,6 +3,7 @@ use num::{complex::Complex, Zero}; use std::f64::consts::PI; +#[allow(clippy::excessive_precision, clippy::assign_op_pattern)] /// Compute the polygamma functions $\psi_k(z)$. /// /// Reimplementation of ``WPSIPG`` (C317) in [CERNlib](http://cernlib.web.cern.ch/cernlib/) diff --git a/crates/ekore/src/harmonics/w1.rs b/crates/ekore/src/harmonics/w1.rs index 8268aad98..a1aa893d9 100644 --- a/crates/ekore/src/harmonics/w1.rs +++ b/crates/ekore/src/harmonics/w1.rs @@ -8,5 +8,5 @@ use crate::harmonics::polygamma::cern_polygamma; /// $$S_1(N) = \sum\limits_{j=1}^N \frac 1 j = \psi_0(N+1)+\gamma_E$$ /// with $\psi_0(N)$ the digamma function and $\gamma_E$ the Euler-Mascheroni constant. pub fn S1(N: Complex) -> Complex { - cern_polygamma(N + 1.0, 0) + 0.5772156649015328606065120 + cern_polygamma(N + 1.0, 0) + 0.577_215_664_901_532_9 } diff --git a/crates/make_bib.py b/crates/make_bib.py index df5437a04..e758c41ad 100644 --- a/crates/make_bib.py +++ b/crates/make_bib.py @@ -10,7 +10,8 @@ BIBFILE = pathlib.Path(__file__).parent / "ekore" / "refs.bib" # A single entry -ENTRY = """/// {title} +ENTRY = """#[allow(non_snake_case)] +/// {title} /// /// {author} /// diff --git a/crates/release.json b/crates/release.json new file mode 100644 index 000000000..c2b9f6f54 --- /dev/null +++ b/crates/release.json @@ -0,0 +1 @@ +["ekore", "eko"] diff --git a/flake.lock b/flake.lock index 55698ed90..d243cec36 100644 --- a/flake.lock +++ b/flake.lock @@ -4,7 +4,9 @@ "inputs": { "flake-compat": "flake-compat", "nix": "nix", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "pre-commit-hooks": "pre-commit-hooks" }, "locked": { @@ -137,16 +139,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1678875422, - "narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=", + "lastModified": 1715787315, + "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459", + "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index d2445852c..28cacfc7c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,10 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - devenv.url = "github:cachix/devenv"; + devenv = { + url = "github:cachix/devenv"; + inputs.nixpkgs.follows = "nixpkgs"; + }; flake-parts.url = "github:hercules-ci/flake-parts"; }; diff --git a/poetry.lock b/poetry.lock index 5b621869b..c8417f447 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3052,13 +3052,13 @@ files = [ [[package]] name = "tomlkit" -version = "0.12.4" +version = "0.12.5" description = "Style preserving TOML library" optional = false python-versions = ">=3.7" files = [ - {file = "tomlkit-0.12.4-py3-none-any.whl", hash = "sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b"}, - {file = "tomlkit-0.12.4.tar.gz", hash = "sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3"}, + {file = "tomlkit-0.12.5-py3-none-any.whl", hash = "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f"}, + {file = "tomlkit-0.12.5.tar.gz", hash = "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c"}, ] [[package]] @@ -3216,4 +3216,4 @@ mark = ["banana-hep", "matplotlib", "pandas", "sqlalchemy"] [metadata] lock-version = "2.0" python-versions = "^3.9,<3.13" -content-hash = "0edd5a00d479078efaa77b4bd5f72810ba42a6d8d82a9460f1e2ace80d5d6851" +content-hash = "075575a682ab1f660b2dd3c0fc20b9c1a43ebb6e50d5d3a5d786a865810718fe" diff --git a/pyproject.toml b/pyproject.toml index 173e7fc8f..89ef66c71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,10 @@ asv = "^0.4.2" virtualenv = "^20.13.2" devtools = "^0.10.0" + +[tool.poetry.group.version.dependencies] +tomlkit = "^0.12.5" + [tool.poetry.extras] mark = ["banana-hep", "sqlalchemy", "pandas", "matplotlib"] box = ["rich", "click"] @@ -124,12 +128,16 @@ asv-publish = "asv publish --config benchmarks/asv.conf.json" asv-show = "asv show --config benchmarks/asv.conf.json" asv-clean = { "shell" = "rm -rf benchmarks/env benchmarks/html benchmarks/results" } asv = ["asv-run", "asv-publish", "asv-preview"] +bump-version = { "shell" = "python crates/bump-versions.py $(git describe --tags)" } compile = "pip install -e crates/eko/" -rdocs.cmd = "cargo doc --workspace --manifest-path crates/Cargo.toml --no-deps" -rdocs.env = { RUSTDOCFLAGS = "--html-in-header katex-header.html" } -rdocs-view = "xdg-open crates/target/doc/ekors/index.html" -rdocs-clean = "rm -rf crates/target/doc/" -rtest = "cargo test --workspace --manifest-path crates/Cargo.toml" +rdocs.cmd = "cargo doc --workspace --no-deps" +rdocs.env = { RUSTDOCFLAGS = "--html-in-header crates/katex-header.html" } +rdocs-view = "xdg-open target/doc/ekors/index.html" +rdocs-clean = "rm -rf target/doc/" +rtest = "cargo test --workspace" +fmtcheck = "cargo fmt --all -- --check" +clippy = "cargo clippy --no-deps" +rbib = { "shell" = "python crates/make_bib.py > crates/ekore/src/bib.rs" } [tool.pytest.ini_options] testpaths = ['tests/', 'benchmarks/'] diff --git a/pyproject.toml.patch b/pyproject.toml.patch index f415c7119..f4ccc7a37 100644 --- a/pyproject.toml.patch +++ b/pyproject.toml.patch @@ -1,5 +1,5 @@ diff --git a/pyproject.toml b/pyproject.toml -index 7404d871..a1e3ae66 100644 +index 088cab32..0d486637 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,20 @@