-
Notifications
You must be signed in to change notification settings - Fork 697
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
Add cabal get --only-package-description
#8263
Conversation
64bd7f4
to
792ccc1
Compare
If anyone could help me with a test, I'd add one. My attempt so far:
Which gives me:
If add
|
Is this bit from cabal-testsuite/README.md helpful?
```
**How can I add a dependency on a package from Hackage in a test?**
By default, the test suite is completely independent of the contents
of Hackage, to ensure that it keeps working across all GHC versions.
If possible, define the package locally. If the package needs
to be from Hackage (e.g., you are testing the global store code
in new-build), use `withRepo "repo"` to initialize a "fake" Hackage with
the packages placed in the `repo` directory.
```
Il 03 luglio 2022 alle 09:35 Artem Pelenitsyn ha scritto:
… If anyone could help me with a test, I'd add one. My attempt so far:
```
import Test.Cabal.Prelude
main = cabalTest $ do
-- cabal "update" [] -- could add that but it has no visible effect
cabal
"get"
[ "text", "--only-package-description" ]
```
Which gives me:
```
-----BEGIN CABAL OUTPUT-----
Error: cabal: There is no package named 'text'.
You may need to run 'cabal update' to get the latest list of available packages.
-----END CABAL OUTPUT-----
```
If add `cabal "update" []` before the `get`, I get another error before that "no package names `text`" one:
```
-----BEGIN CABAL OUTPUT-----
No remote repositories configured
-----END CABAL OUTPUT-----
```
--
Reply to this email directly or view it on GitHub:
#8263 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
Many thanks for continuing the work of #5162 |
With this option, 'cabal get' writes to the destination directory only the package description already available locally in one of the repository indices. The basename of the file name written to inside the target directory is the package-id rather than only the package name. This is mostly based on haskell#1977 Co-authored-by: Miëtek Bak <mietek@bak.io> Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect, many thanks for leveraging and completing the existing work
With this option, 'cabal get' writes to the destination directory only the package description already available locally in one of the repository indices. The basename of the file name written to inside the target directory is the package-id rather than only the package name. This is mostly based on haskell#1977 Co-authored-by: Miëtek Bak <mietek@bak.io> Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com> Co-authored-by: Herbert Valerio Riedel <hvr@gnu.org> Co-authored-by: Miëtek Bak <mietek@bak.io>
With this option, 'cabal get' writes to the destination directory only the package description already available locally in one of the repository indices. The basename of the file name written to inside the target directory is the package-id rather than only the package name. This is mostly based on haskell#1977 Co-authored-by: Miëtek Bak <mietek@bak.io> Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com> Co-authored-by: Herbert Valerio Riedel <hvr@gnu.org> Co-authored-by: Miëtek Bak <mietek@bak.io>
This is based on #1977 and #5162, with a hope to finally close #1954.
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!