Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 0.7.0 #84

Merged
merged 6 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 9 additions & 38 deletions .github/workflows/cabal-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.8.4', '8.10.7', '9.0.1']
cabal: ['3.4.0.0']
os: ['ubuntu-18.04', 'ubuntu-20.04', 'macOS-latest']
ghc: ['8.10.7', '9.0.1', '9.2', '9.4', '9.6']
cabal: ['3.10']
os: ['ubuntu-22.04', 'ubuntu-20.04', 'macOS-latest']
remoteConfigs: ['-remote-configs', '+remote-configs']
include:
- ghc: '9.2'
cabal: '3.6.2.0'
os: 'ubuntu-20.04'
cabal: '3.6'
os: 'ubuntu-22.04'
remoteConfigs: '+remote-configs'

steps:

# Setup
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install GHC and Cabal
uses: larskuhtz/actions/setup@e0f107055073590682bc5264b8da5c2b6af39a65
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
Expand All @@ -40,44 +40,15 @@ jobs:
flags: ${{ matrix.remoteConfigs }}
EOF

# GHC 9.2
- name: Configure project
if: "startsWith(matrix.ghc, '9.2')"
run: |
cat >> cabal.project.local <<EOF
constraints: aeson >=2.0
constraints: yaml >=0.11.7.0
allow-newer: *
source-repository-package
type: git
location: https://github.com/haskell/aeson
tag: bfc8de2a155fb6725701ec692e8a6db3986cfb36
source-repository-package
type: git
location: https://github.com/snoyberg/yaml.git
tag: c4392f3855002ab0bbf9bc16e1e32034254234a7
subdir: yaml
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
key-threshold: 3
root-keys:
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d

active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF

# Restore Packages from Caches
- uses: actions/cache@v2
- uses: actions/cache@v3
name: Cache cabal packages
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ matrix.os }}-${{ matrix.ghc }}-2-cabal
key: ${{ matrix.os }}-${{ matrix.ghc }}-cabal

# Build
- name: Update package database
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/stack-ci.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# configuration-tools

## 0.7.0 (2022-06-22)

The version bump is due to the update of the dependency on optparse-applicative,
which could imply breaking changes for users.

* Support GHC-9.6.
* Require Cabal >=3.6.
* Drop support for GHC <8.10.
* Require optparse-applicative >=0.18.
* Require prettyprinter package and drop dependency on deprecated ansi-wl-pprint.
* Replace dependency on cryptonite package by crypton.
* Raise some outdated lower dependency bounds.

## 0.6.1 (2021-10-12)

* Support GHC-9.2
Expand Down
30 changes: 3 additions & 27 deletions Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,8 @@ import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.PackageIndex
import Distribution.Simple.Setup
import Distribution.Text
import Distribution.Types.UnqualComponentName

#if MIN_VERSION_Cabal(3,6,0)
import Distribution.Utils.Path
#endif

#if MIN_VERSION_Cabal(3,2,0)
import Distribution.Utils.ShortText
#endif

import System.Process

Expand Down Expand Up @@ -169,14 +162,6 @@ mkPkgInfoModules hooks = hooks
prettyLicense :: I.InstalledPackageInfo -> String
prettyLicense = either prettyShow prettyShow . I.license

#if MIN_VERSION_Cabal(3,2,0)
ft :: ShortText -> String
ft = fromShortText
#else
ft :: String -> String
ft = id
#endif

-- -------------------------------------------------------------------------- --
-- Cabal 2.0

Expand Down Expand Up @@ -238,11 +223,7 @@ trim :: String -> String
trim = f . f
where f = reverse . dropWhile isSpace

#if defined (MIN_VERSION_Cabal) && MIN_VERSION_Cabal(3,4,0)
getVCS :: IO (Maybe KnownRepoType)
#else
getVCS :: IO (Maybe RepoType)
#endif
getVCS = getCurrentDirectory >>= getVcsOfDir
where
getVcsOfDir d = do
Expand Down Expand Up @@ -318,10 +299,10 @@ pkgInfoModule moduleName cName pkgDesc bInfo = do
, " copyright = " <> (pack . show . copyright) pkgDesc
, ""
, " author :: IsString a => a"
, " author = \"" <> (pack . ft . author) pkgDesc <> "\""
, " author = \"" <> (pack . fromShortText . author) pkgDesc <> "\""
, ""
, " homepage :: IsString a => a"
, " homepage = \"" <> (pack . ft . homepage) pkgDesc <> "\""
, " homepage = \"" <> (pack . fromShortText . homepage) pkgDesc <> "\""
, ""
, " package :: IsString a => a"
, " package = \"" <> (pack . display . package) pkgDesc <> "\""
Expand Down Expand Up @@ -382,12 +363,7 @@ licenseFilesText pkgDesc =
fileText file = doesFileExist file >>= \x -> if x
then B.readFile file
else return ""

#if MIN_VERSION_Cabal(3,6,0)
fileTextStr = fileText . getSymbolicPath
#else
fileTextStr = fileText
#endif


hgInfo :: IO (String, String, String)
Expand Down Expand Up @@ -418,4 +394,4 @@ pkgIdWithLicense a = (display . packageId) a
++ (if cr /= "" then ", " ++ cr else "")
++ "]"
where
cr = (unwords . words . ft . I.copyright) a
cr = (unwords . words . fromShortText . I.copyright) a
64 changes: 33 additions & 31 deletions configuration-tools.cabal
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
cabal-version: 2.2
cabal-version: 3.0

name: configuration-tools
version: 0.6.1
version: 0.7.0
synopsis: Tools for specifying and parsing configurations
description:
Tools for specifying and parsing configurations
.

This package provides a collection of utils on top of the packages
<http://hackage.haskell.org/package/optparse-applicative optparse-applicative>,
<http://hackage.haskell.org/package/aeson aeson>, and
<http://hackage.haskell.org/package/yaml yaml> for configuring libraries and
applications in a convenient and composable way.
.

The main features are
.

1. configuration management through integration of command line option
parsing and configuration files and
.

2. a @Setup.hs@ file that generates a @PkgInfo@ module for each component
of a package that provides information about the package and the build.
.

Documentation on how to use this package can be found in the
<https://github.com/alephcloud/hs-configuration-tools/blob/master/README.md README>
and in the API documentation of the modules "Configuration.Utils" and
Expand All @@ -33,23 +33,25 @@ author: Lars Kuhtz <lakuhtz@gmail.com>
maintainer: Lars Kuhtz <lakuhtz@gmail.com>
copyright:
(c) 2019-2020 Colin Woodbury <colin@fosskers.ca>,
(c) 2015-2021 Lars Kuhtz <lakuhtz@gmail.com>,
(c) 2015-2023 Lars Kuhtz <lakuhtz@gmail.com>,
(c) 2014-2015 AlephCloud, Inc.
category: Configuration, Console
build-type: Custom
tested-with:
GHC==9.0.1
, GHC==9.6
, GHC==9.4
, GHC==9.2
, GHC==9.0.1
, GHC==8.10.7
, GHC==8.8.4

extra-doc-files:
README.md,
CHANGELOG.md

custom-setup
setup-depends:
Cabal >= 2.2,
base >= 4.11 && < 5.0,
Cabal >= 3.6 && < 100,
base >= 4.14 && < 5.0,
bytestring >= 0.10.0.2,
directory >= 1.2.1.0,
filepath >= 1.3.0.1,
Expand Down Expand Up @@ -95,11 +97,11 @@ library
Configuration.Utils.Internal.HttpsCertPolicy

build-depends:
Cabal >= 2.2
Cabal >= 3.6
, aeson >= 0.7.0.6
, ansi-wl-pprint >= 0.6
, prettyprinter >= 1.7
, attoparsec >= 0.11.3.4
, base >= 4.11 && < 5
, base >= 4.14 && < 5
, base-unicode-symbols >= 0.2.2.4
, bytestring >= 0.10.0.2
, case-insensitive >= 1.2
Expand All @@ -109,7 +111,7 @@ library
, filepath >= 1.3.0.1
, mtl >= 2.2
, network-uri >= 2.6.0.1
, optparse-applicative >= 0.11.0.2
, optparse-applicative >= 0.18
, process >= 1.2.0.0
, profunctors >= 4.0.4
, semigroups >= 0.18
Expand All @@ -123,17 +125,17 @@ library
if flag(remote-configs)
build-depends:
base64-bytestring >= 1.0
, connection >= 0.2
, crypton-connection >= 0.3
, crypton-x509 >= 1.5
, crypton-x509-system >= 1.5
, crypton-x509-validation >= 1.5.1
, data-default >= 0.5
, enclosed-exceptions >= 1.0
, http-client >= 0.4.30
, http-client-tls >= 0.2
, http-client >= 0.5
, http-client-tls >= 0.3
, http-types >= 0.8
, monad-control >= 1.0
, tls >= 1.2
, x509 >= 1.5
, x509-system >= 1.5
, x509-validation >= 1.5.1

if flag(remote-configs)
cpp-options: -DREMOTE_CONFIGS
Expand All @@ -156,8 +158,8 @@ test-suite url-example-test
PkgInfo

build-depends:
Cabal >= 2.2
, base >= 4.11 && < 5
Cabal >= 3.6
, base >= 4.14 && < 5
, base-unicode-symbols >= 0.2.2.4
, bytestring >= 0.10
, configuration-tools
Expand All @@ -172,9 +174,9 @@ test-suite url-example-test
enclosed-exceptions >= 1.0
, http-types >= 0.8
, monad-control >= 1.0
, wai >= 3.0
, warp >= 3.0
, warp-tls >= 3.0
, wai >= 3.2
, warp >= 3.3
, warp-tls >= 3.4
, network >= 2.8

cpp-options: -DREMOTE_CONFIGS
Expand All @@ -193,9 +195,9 @@ test-suite trivial
PkgInfo

build-depends:
base >= 4.11 && < 5
base >= 4.14 && < 5
, base-unicode-symbols >= 0.2.2.4
, Cabal >= 2.2
, Cabal >= 3.6
, configuration-tools

executable example
Expand All @@ -209,8 +211,8 @@ executable example
autogen-modules:
PkgInfo
build-depends:
base >= 4.11 && < 5
base >= 4.14 && < 5
, base-unicode-symbols >= 0.2.2.4
, Cabal >= 2.2
, Cabal >= 3.6
, configuration-tools
, mtl >= 2.2
4 changes: 0 additions & 4 deletions examples/Example.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ import Control.Monad.Writer

import Data.Monoid.Unicode

#if MIN_VERSION_base(4,13,0)
import Prelude.Unicode hiding ((×))
#else
import Prelude.Unicode
#endif

-- This assumes usage of cabal with custom Setup.hs
--
Expand Down
Loading