Skip to content

Commit

Permalink
Remove GHC_VERSION constant from lib
Browse files Browse the repository at this point in the history
  • Loading branch information
phihos committed Feb 14, 2024
1 parent c28f1cb commit 6406926
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 9 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<release version>`
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<release version>`
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 `<future release version> (unreleased)`.
13. git add -A && git commit -m "Back to work"
14. git push upstream master


[<a name="explanation">1</a>] We need to append '-dev0', as Cargo does not support the '.dev0'
Expand Down
5 changes: 0 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 1 addition & 2 deletions duckling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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))?;
Expand Down

0 comments on commit 6406926

Please sign in to comment.