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

[dev2][command-list] Refactor #12756

Merged
merged 19 commits into from
Dec 22, 2022

Conversation

franramirez688
Copy link
Contributor

@franramirez688 franramirez688 commented Dec 21, 2022

Changelog: Feature: Refactored conan list and dropped all the subcommands.
Docs: conan-io/docs#2874
Closes: #12651

Quick summary:

COMMAND RESULT
conan list * show all the references matching that pattern
conan list zlib/*(== conan list zlib) show all the references matching that pattern
conan list zlib/1.2.11.* show all the references matching that pattern. If it does not exist, it shows an error.
conan list zlib/1.2.11 (== conan list zlib/1.2.11#latest) show the latest RREV (if exact match with the reference, e.g., zlib/1.2.11). If it does not exist, it shows an error.
conan list zlib/1.2.11#* show all the RREVS
conan list zlib/1.2.11#RREV (== conan list zlib/1.2.11#RREV:*) show all the PIDs for that RREV.
conan list zlib/1.2.11:* (== conan list zlib/1.2.11#latest:*) show all the configurations for all the PIDs belonging to the the latest RREV.
conan list zlib/1.2.11#: show all the configurations for all the PIDs and RREVs
conan list zlib/1.2.11:abhhaf* show all the configurations for all the PIDs belonging to the latest RREV and matching the pattern
conan list zlib/1.2.11:PID (== conan list zlib/1.2.11#latest:PID#latest) show the latest PREV
conan list zlib/1.2.11:PID#* show all the PREVS for the latest RREV and that PID
conan list zlib/1.2.11#:#* show all the PREVS for all the RREVs and all the PIDs

conan/cli/commands/list.py Outdated Show resolved Hide resolved
@czoido
Copy link
Contributor

czoido commented Dec 21, 2022

Some some comments of preliminar tests with the branch (I have only and imaginary zlib/1.2.18 in local cache):

➜ conan list zlib                               
zlib/1.2.18

Shouldn't it say that this package is in the local cache?

➜ conan list zlib -r conancenter                            
zlib/1.2.11
zlib/1.2.12
zlib/1.2.13
zlib/1.2.8

Also with this does not say where those package are and I the --cache option is missing.

In my local cache I have one package id for zlib/1.2.18 but not package id's in conancenter but we don't output some message like there are no binaries in the remote or or error:

local cache: good

➜ conan list "zlib/1.2.18#latest:*"
zlib/1.2.18#12714b06f016d106937a277a3d6ea272
  zlib/1.2.18#12714b06f016d106937a277a3d6ea272:b1d267f77ddd5d10d06d2ecf5a6bc433fbb7eeed
    settings:
      arch=x86_64
      build_type=Release
      compiler=apple-clang
      compiler.cppstd=gnu11
      compiler.libcxx=libc++
      compiler.version=14
      os=Macos
    options:
      fPIC=True
      shared=False

conancenter, should we error? we output only the revision as there are no packages there:

➜ conan list "zlib/1.2.12#latest:*" -r conancenter
zlib/1.2.12#b1fd071d8a2234a488b3ff74a3526f81

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks a very good step!
It is missing some details, I think it might be incomplete for user/channel

conan/internal/api/select_pattern.py Outdated Show resolved Hide resolved
conan/api/model.py Outdated Show resolved Hide resolved
Co-authored-by: James <memsharded@gmail.com>
Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that my review is worth much yet, but I can't see anything wrong with the changes other than what's already been pointed out (And the failing test, but I'm guessing that's for later still), nice work :)

@franramirez688 franramirez688 marked this pull request as ready for review December 22, 2022 11:43
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there.
Please check the pending comments, specially about conan search.

conan/cli/commands/__init__.py Outdated Show resolved Hide resolved
conan/internal/api/select_pattern.py Outdated Show resolved Hide resolved
conan/cli/commands/search.py Outdated Show resolved Hide resolved
conan/cli/commands/search.py Outdated Show resolved Hide resolved
franramirez688 and others added 3 commits December 22, 2022 13:22
Co-authored-by: James <memsharded@gmail.com>
@czoido
Copy link
Contributor

czoido commented Dec 22, 2022

Testing this:

$ conan list "zlib/1.2.18#:*#"
Local Cache:
  zlib
    zlib/1.2.18#12714b06f016d106937a277a3d6ea272 (2022-12-21 16:58:43 UTC)
      PID: b1d267f77ddd5d10d06d2ecf5a6bc433fbb7eeed (2022-12-21 16:58:44 UTC)
        settings:
          arch=x86_64
          build_type=Release
          compiler=apple-clang
          compiler.cppstd=gnu11
          compiler.libcxx=libc++
          compiler.version=14
          os=Macos
        options:
          fPIC=True
          shared=False

Shouldn't it return the last package revision for each package id as we are adding the # in the end?

@czoido czoido self-assigned this Dec 22, 2022
@czoido
Copy link
Contributor

czoido commented Dec 22, 2022

Much better the new conan list command with these changes

@czoido czoido merged commit 0b74648 into conan-io:develop2 Dec 22, 2022
AbrilRBS pushed a commit to AbrilRBS/conan that referenced this pull request Dec 23, 2022
* Refactoring list command

* wip

* Update conan/api/model.py

Co-authored-by: James <memsharded@gmail.com>

* wip

* wip

* wip

* Test passing

* wip

* Tests OK

* tests ok

* Update conan/cli/commands/search.py

Co-authored-by: James <memsharded@gmail.com>

* wip

* fixed

* Fixed tests

* Fixed

* fix

* step by step

* fixed settings

* Fixed

Co-authored-by: James <memsharded@gmail.com>
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.

4 participants