From 6406926c0ebc1c015fc56c62d3494cb0c89e3c57 Mon Sep 17 00:00:00 2001 From: Philipp Hossner Date: Wed, 14 Feb 2024 23:31:00 +0100 Subject: [PATCH] Remove GHC_VERSION constant from lib --- README.md | 8 ++++++++ RELEASE.md | 16 +++++++++------- build.rs | 5 ----- build.sh | 1 - duckling/__init__.py | 3 +-- src/lib.rs | 2 -- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index bfdbccc..e28785e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,15 @@ pip install pyduckling-native-phihos > ℹ️ Right now, we only provide package distributions for Linux (x86_64). +## Version Matrix +The following table shows which PyDuckling version corresponds to which Duckling version + +| PyDuckling | Duckling | +|--------------------|-------------------------------------------------------------------| +| 0.2.0 (unreleased) | v0.2.0.0 (commit [7520daa](https://github.com/facebook/duckling)) | +| | | +| | | ## Package usage PyDuckling provides access to the parsing capabilities of Duckling used to extract structured data from text. diff --git a/RELEASE.md b/RELEASE.md index 16fec6f..cf08960 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -10,13 +10,15 @@ To release a new version of pyduckling: ``` 4. git add -A && git commit -m "Update Changelog" 5. Update release version in ``Cargo.toml`` (set release version, remove 'dev0') -6. git add -A && git commit -m "Release vX.X.X" -7. git push upstream master -8. Make release on Github and use tag `v` -9. Wait for GitHub Actions to upload the wheels to PyPI -10. Update development version in ``Cargo.toml`` (add '-dev0' and increment minor, see [1](#explanation)) -11. git add -A && git commit -m "Back to work" -12. git push upstream master +6. Update the [version matrix](./README.md#version-matrix) in `README.md` by removing the `(unreleased)` behind the release version. +7. git add -A && git commit -m "Release vX.X.X" +8. git push upstream master +9. Make release on Github and use tag `v` +10. Wait for GitHub Actions to upload the wheels to PyPI +11. Update development version in ``Cargo.toml`` (add '-dev0' and increment minor, see [1](#explanation)) +12. Update the [version matrix](./README.md#version-matrix) in `README.md` by adding ` (unreleased)`. +13. git add -A && git commit -m "Back to work" +14. git push upstream master [1] We need to append '-dev0', as Cargo does not support the '.dev0' diff --git a/build.rs b/build.rs index 8856e7b..7aa996a 100644 --- a/build.rs +++ b/build.rs @@ -3,13 +3,8 @@ use std::env; fn main() { let dir_path = env::current_dir().unwrap(); let path = dir_path.to_str().unwrap(); - let ghc_version = match env::var_os("GHC_VERSION") { - Some(v) => v.into_string().unwrap(), - None => panic!("$GHC_VERSION is not set"), - }; println!("cargo:rustc-link-lib=static=ducklingffi"); println!("cargo:rustc-link-search=native={}/ext_lib/", path); println!("cargo:rustc-link-lib=dylib=pcre"); println!("cargo:rustc-link-lib=dylib=gmp"); - println!("cargo:rustc-env=GHC_VERSION={}", ghc_version); } diff --git a/build.sh b/build.sh index ff8a747..0266652 100755 --- a/build.sh +++ b/build.sh @@ -58,7 +58,6 @@ function build_python_package() { --mount type=bind,source="${USER_HOME_CACHE_PATH}",target=/userhome \ --user "$(id -u):$(id -g)" \ --name "${CONTAINER_NAME}" \ - -e GHC_VERSION \ -e HOME=/userhome \ -e VENV="/userhome/${VENV_NAME}" \ --detach \ diff --git a/duckling/__init__.py b/duckling/__init__.py index 46dadda..11e591d 100644 --- a/duckling/__init__.py +++ b/duckling/__init__.py @@ -18,10 +18,9 @@ get_current_ref_time, parse_ref_time, parse_lang, default_locale_lang, parse_locale, parse_dimensions, parse_text, Context, Dimension, - Locale, __version__, GHC_VERSION) + Locale, __version__) __version__ -GHC_VERSION init stop load_time_zones diff --git a/src/lib.rs b/src/lib.rs index 9f34bc3..deb73ae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,7 +24,6 @@ use std::sync::Once; // Package version const VERSION: &'static str = env!("CARGO_PKG_VERSION"); -const GHC_VERSION: &'static str = env!("GHC_VERSION"); // Haskell runtime status static START_ONCE: Once = Once::new(); @@ -516,7 +515,6 @@ fn parse_text( #[pymodule] fn duckling(_py: Python, m: &PyModule) -> PyResult<()> { m.add("__version__", VERSION)?; - m.add("GHC_VERSION", GHC_VERSION)?; m.add_wrapped(wrap_pyfunction!(load_time_zones))?; m.add_wrapped(wrap_pyfunction!(get_current_ref_time))?; m.add_wrapped(wrap_pyfunction!(parse_ref_time))?;