Skip to content

Drop Timex, bump HTTPoison 2.x, fix modern OTP builds#82

Open
kidbombay wants to merge 5 commits intosmeevil:masterfrom
kidbombay:cursor/remove-timex-dependency
Open

Drop Timex, bump HTTPoison 2.x, fix modern OTP builds#82
kidbombay wants to merge 5 commits intosmeevil:masterfrom
kidbombay:cursor/remove-timex-dependency

Conversation

@kidbombay
Copy link
Copy Markdown

@kidbombay kidbombay commented May 4, 2026

Summary

Modernizes dependencies and tooling so Cloudex builds on current Erlang/OTP (including OTP 28) and current Elixir, removes Timex from the signing path, upgrades HTTPoison to 2.x, and updates dev/test tooling and ExUnit. Cloudinary signing and HTTP usage stay the same from an API perspective, aside from using the standard library for the signing timestamp.

Motivation

  • Timex was only used for a Unix timestamp in signed requests; :os.system_time/1 is enough and drops tzdata and other transitive weight.
  • HTTPoison 1.x / older Hackney / ssl_verify_fun are problematic on newer OTP; HTTPoison 2.x tracks a supported Hackney line. An explicit ssl_verify_fun override avoids resolving 1.1.5, which fails to compile on OTP 26+.
  • Dev/test dependencies are bumped so the project compiles without Mix/Elixir deprecation noise on recent toolchains.
  • Config uses import Config / config_env() instead of deprecated Mix.Config.
  • Tests run with async: true where appropriate; the env test restores CLOUDEX_API_KEY so the global environment is not leaked.

Changes

Area Details
Runtime deps Remove timex / tzdata. HTTPoison ~> 2.3. Optional jason unchanged. ssl_verify_fun ~> 1.1.7 override for safe resolution.
Elixir Require ~> 1.11 (required by HTTPoison 2).
Cloudex.CloudinaryApi Signing timestamp: :os.system_time(:second). JSON backend: Application.compile_env(:cloudex, :json_library, Jason).
Cloudex.Url Doctest: charlist examples → strings ("auto", "progressive").
Config import Config, import_config "#{config_env()}.exs" in config/config.exs; same pattern in dev / test / prod.
Mix def cli/0 with preferred_envs (replaces deprecated preferred_cli_env in project/0).
Dev/test Credo ~> 1.7, Dialyxir ~> 1.4, Mix.Test.Watch ~> 1.4, ExVCR ~> 0.17.
Tests use ExUnit.Case, async: true on test modules; EnvOptionsTest uses on_exit to restore CLOUDEX_API_KEY.
Other cloudex.iml: remove stale library entries for dropped deps.

Breaking changes

  1. Elixir: minimum 1.11 (previously declared ~> 1.7 in mix.exs).
  2. HTTPoison 2: downstream apps that pinned HTTPoison 1.x may need to move to 2.x. See HTTPoison — upgrading to 2.x.x (notably ssl vs ssl_override if you pass custom SSL options; Cloudex does not today).
  3. Timex: anything that relied on Timex only as a transitive dependency of Cloudex must add Timex explicitly.

Testing

  • mix compile
  • mix test (including doctests)

Optional follow-ups (out of scope here)

  • CHANGELOG + version bump for a Hex release.
  • Document minimum Elixir / OTP in the README.

@kidbombay kidbombay changed the title Cursor/remove timex dependency Drop Timex, bump HTTPoison 2.x, fix modern OTP builds May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant