Skip to content

Commit

Permalink
[1.x] Backport fmt 11 support (#3429)
Browse files Browse the repository at this point in the history
* Fix linter

* Remove constraint on fmt

* Backport fmt 11 support from main

* Add missing header

* Try removing upper bound on fmt

---------

Co-authored-by: Julien Jerphanion <[email protected]>
  • Loading branch information
Hind-M and jjerphan authored Sep 5, 2024
1 parent 25cdc05 commit aea0495
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libmamba/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ dependencies:
- yaml-cpp >=0.8.0
- cli11 >=2.2
- spdlog
- fmt < 11 # TODO remove constraint when backporting the fix for fmt last release (from mamba main branch)
- fmt
- sel(win): winreg
2 changes: 1 addition & 1 deletion libmamba/include/mamba/core/mamba_fs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ struct fmt::formatter<::fs::u8path>
}

template <class FormatContext>
auto format(const ::fs::u8path& path, FormatContext& ctx)
auto format(const ::fs::u8path& path, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "'{}'", path.string());
}
Expand Down
4 changes: 2 additions & 2 deletions libmamba/include/mamba/specs/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ struct fmt::formatter<mamba::specs::VersionPartAtom>
}

template <class FormatContext>
auto format(const ::mamba::specs::VersionPartAtom atom, FormatContext& ctx)
auto format(const ::mamba::specs::VersionPartAtom atom, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "{}{}", atom.numeral(), atom.literal());
}
Expand All @@ -188,7 +188,7 @@ struct fmt::formatter<mamba::specs::Version>
}

template <class FormatContext>
auto format(const ::mamba::specs::Version v, FormatContext& ctx)
auto format(const ::mamba::specs::Version v, FormatContext& ctx) const
{
auto out = ctx.out();
if (v.epoch() != 0)
Expand Down
3 changes: 1 addition & 2 deletions libmamba/include/mamba/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
(LIBMAMBA_VERSION_MAJOR * 10000 + LIBMAMBA_VERSION_MINOR * 100 + LIBMAMBA_VERSION_PATCH)
#define LIBMAMBA_VERSION_STRING \
__LIBMAMBA_STRINGIZE(LIBMAMBA_VERSION_MAJOR) \
"." __LIBMAMBA_STRINGIZE(LIBMAMBA_VERSION_MINOR) "." __LIBMAMBA_STRINGIZE( \
LIBMAMBA_VERSION_PATCH)
"." __LIBMAMBA_STRINGIZE(LIBMAMBA_VERSION_MINOR) "." __LIBMAMBA_STRINGIZE(LIBMAMBA_VERSION_PATCH)

namespace mamba
{
Expand Down
1 change: 1 addition & 0 deletions libmamba/src/api/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <fmt/color.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <reproc++/run.hpp>
#include <reproc/reproc.h>

Expand Down
2 changes: 1 addition & 1 deletion libmamba/src/core/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <iostream>

#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <spdlog/pattern_formatter.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
Expand Down
1 change: 1 addition & 0 deletions libmamba/src/core/package_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <tuple>

#include <fmt/format.h>
#include <fmt/ranges.h>

#include "mamba/core/package_info.hpp"
#include "mamba/specs/archive.hpp"
Expand Down
1 change: 1 addition & 0 deletions libmamba/src/core/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <fmt/color.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <solv/evr.h>
#include <spdlog/spdlog.h>

Expand Down
1 change: 1 addition & 0 deletions libmamba/src/core/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <fmt/color.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <nlohmann/json.hpp>
#include <reproc++/run.hpp>
#include <spdlog/spdlog.h>
Expand Down
1 change: 1 addition & 0 deletions libmamba/tests/src/core/test_satisfiability_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <doctest/doctest.h>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <nlohmann/json.hpp>
#include <solv/solver.h>

Expand Down
1 change: 1 addition & 0 deletions libmamba/tests/src/doctest-printer/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <doctest/doctest.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

namespace doctest
{
Expand Down
1 change: 1 addition & 0 deletions libmamba/tests/src/doctest-printer/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <doctest/doctest.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

namespace doctest
{
Expand Down
1 change: 1 addition & 0 deletions libmamba/tests/src/specs/test_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <doctest/doctest.h>
#include <fmt/format.h>
#include <fmt/ranges.h>

#include "mamba/specs/version.hpp"

Expand Down
1 change: 1 addition & 0 deletions libmambapy/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stdexcept>

#include <fmt/format.h>
#include <fmt/ranges.h>
#include <nlohmann/json.hpp>
#include <pybind11/functional.h>
#include <pybind11/iostream.h>
Expand Down
2 changes: 1 addition & 1 deletion micromamba/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ dependencies:
- conda-package-handling
- pyyaml
- spdlog
- fmt <10
- fmt
- sel(win): winreg
- sel(win): pywin32
1 change: 1 addition & 0 deletions micromamba/src/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <fmt/color.h>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <nlohmann/json.hpp>
#include <reproc++/run.hpp>
#include <spdlog/spdlog.h>
Expand Down

0 comments on commit aea0495

Please sign in to comment.