Skip to content

Commit

Permalink
Merge pull request #929 from hove-io/upgrade-crates
Browse files Browse the repository at this point in the history
[tech] Upgrade crates
  • Loading branch information
datanel committed Nov 28, 2023
2 parents b1b00f8 + 5f75cab commit a4faac0
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 249 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/continuous-integration-deb11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
name: Rust fmt check
needs: aws_creds
runs-on: [self-hosted, dataeng, sandbox]
container:
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-deb11
credentials:
username: AWS
Expand All @@ -43,7 +43,7 @@ jobs:
needs: aws_creds
runs-on: [self-hosted, dataeng, sandbox]
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11
credentials:
username: AWS
password: ${{ needs.aws_creds.outputs.token }}
Expand All @@ -56,7 +56,7 @@ jobs:
needs: aws_creds
runs-on: [self-hosted, dataeng, sandbox]
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11
credentials:
username: AWS
password: ${{ needs.aws_creds.outputs.token }}
Expand All @@ -71,7 +71,7 @@ jobs:
needs: aws_creds
runs-on: [self-hosted, dataeng, sandbox]
container:
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11
image: 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11
credentials:
username: AWS
password: ${{ needs.aws_creds.outputs.token }}
Expand Down
164 changes: 0 additions & 164 deletions .github/workflows/continuous-integration.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Hove <[email protected]>", "Guillaume Pinot <[email protected]>"]
name = "transit_model"
version = "0.58.0"
version = "0.58.1"
license = "AGPL-3.0-only"
description = "Transit data management"
repository = "https://github.com/hove-io/transit_model"
Expand Down Expand Up @@ -43,7 +43,7 @@ chrono = { version = "0.4", default-features = false, features = ["std", "clock"
chrono-tz = { version = "0.8", features = ["serde"] }
csv = "1"
derivative = "2"
geo = "0.25"
geo = "0.27"
iso4217 = "0.3"
lazy_static = "1"
md5 = "0.7"
Expand All @@ -54,7 +54,7 @@ minidom_ext = { git = "https://github.com/hove-io/minidom_ext", tag="v1"}
minidom_writer = { git = "https://github.com/hove-io/minidom_writer", tag = "v1"}
num-traits = "0.2"
pretty_assertions = "1"
proj = { version = "0.25", optional = true } # libproj version used by 'proj' crate must be propagated to CI and makefile
proj = { version = "0.27", optional = true } # libproj version used by 'proj' crate must be propagated to CI and makefile
relational_types = { git = "https://github.com/hove-io/relational_types", tag = "v2"}
rust_decimal = "1"
serde = { version = "1", features = ["derive"] }
Expand Down
9 changes: 0 additions & 9 deletions Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile_deb11
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj8.1.1-deb11 as builder
FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-rust-ci:latest-proj9.3.0-deb11 as builder
WORKDIR /usr/src/app
COPY . ./
RUN git describe --tags --always && git status
RUN cargo build --workspace --release
RUN mkdir /usr/src/bin && for file in ls ${CARGO_TARGET_DIR:-./target}/release/*; do if test -f $file -a -x $file; then cp $file /usr/src/bin; fi; done

FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-proj-ci:8.1.1-deb11
FROM 162230498103.dkr.ecr.eu-west-1.amazonaws.com/mutable-proj-ci:9.3.0-deb11
COPY --from=builder /usr/src/bin/* /usr/local/bin/
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version required by `proj` crate used in cargo.toml
PROJ_VERSION = 8.1.0
PROJ_VERSION = 9.3.0

install_proj_deps: ## Install dependencies the proj crate needs in order to build libproj from source
sudo apt update
Expand All @@ -14,9 +14,12 @@ install_proj: install_proj_deps ## Install PROJ on system (avoid PROJ recompilin

wget https://github.com/OSGeo/proj.4/releases/download/$(PROJ_VERSION)/proj-$(PROJ_VERSION).tar.gz
tar -xzvf proj-$(PROJ_VERSION).tar.gz
cd proj-$(PROJ_VERSION) && ./configure --prefix=/usr
make -C proj-$(PROJ_VERSION)
sudo make install -C proj-$(PROJ_VERSION)
cd proj-$(PROJ_VERSION) \
&& mkdir build \
&& cd build \
&& cmake .. \
&& cmake --build . -j11 \
&& sudo cmake --build . --target install
rm -rf proj-$(PROJ_VERSION) proj-$(PROJ_VERSION).tar.gz

fmt: format ## Check formatting of the code (alias for 'format')
Expand Down
2 changes: 1 addition & 1 deletion gtfs2netexfr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ keywords = ["gtfs", "netex", "transit"]

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }
clap = { version = "3", features = ["derive"] }
clap = { version = "4", features = ["derive"] }
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
transit_model = { path = "../", features = ["proj"] }
Expand Down
21 changes: 10 additions & 11 deletions gtfs2netexfr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,51 @@ fn get_version() -> &'static str {
}

#[derive(Debug, Parser)]
#[clap(name = "gtfs2netexfr", about = "Convert a GTFS to NeTEx France.", version = get_version())]
#[command(name = "gtfs2netexfr", about = "Convert a GTFS to NeTEx France.", version = get_version())]
struct Opt {
/// Input directory.
#[clap(short, long, parse(from_os_str), default_value = ".")]
#[arg(short, long, default_value = ".")]
input: PathBuf,

/// Output directory.
#[clap(short, long, parse(from_os_str))]
#[arg(short, long)]
output: PathBuf,

/// JSON file containing additional configuration.
///
/// For more information, see
/// https://github.com/hove-io/transit_model/blob/master/documentation/common_ntfs_rules.md#configuration-of-each-converter
#[clap(short, long, parse(from_os_str))]
#[arg(short, long)]
config: Option<PathBuf>,

/// Indicates if the input GTFS contains On-Demand Transport (ODT)
/// information.
#[clap(short = 't', long = "on-demand-transport")]
#[arg(short = 't', long = "on-demand-transport")]
odt: bool,

/// On-Demand Transport GTFS comment
#[clap(long = "odt-comment")]
#[arg(long = "odt-comment")]
odt_comment: Option<String>,

/// Name for the participant.
///
/// For more information, see
/// https://github.com/hove-io/transit_model/blob/master/documentation/ntfs_to_netex_france_specs.md#input-parameters
#[clap(short, long)]
#[arg(short, long)]
participant: String,

/// Code for the provider of stops.
///
/// For more information, see
/// https://github.com/hove-io/transit_model/blob/master/documentation/ntfs_to_netex_france_specs.md#input-parameters
#[clap(short, long)]
#[arg(short, long)]
stop_provider: Option<String>,

/// Current datetime.
#[clap(
#[arg(
short = 'x',
long,
parse(try_from_str),
default_value = &transit_model::CURRENT_DATETIME
default_value = &**transit_model::CURRENT_DATETIME
)]
current_datetime: DateTime<FixedOffset>,
}
Expand Down
2 changes: 1 addition & 1 deletion gtfs2ntfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ keywords = ["gtfs", "ntfs", "transit"]

[dependencies]
chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }
clap = { version = "3", features = ["derive"] }
clap = { version = "4", features = ["derive"] }
tracing = { version = "0.1", features = ["log", "release_max_level_info"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
transit_model = { path = "../" }
Expand Down
Loading

0 comments on commit a4faac0

Please sign in to comment.