Skip to content

new alias #2169

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

Merged
merged 1 commit into from
Jul 26, 2021
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
4 changes: 4 additions & 0 deletions reference/commands/misc/alias.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ downstream with ``version-ranges``.

The "alias" package should be uploaded to servers in the same way as regular package recipes, in
order to enable usage from servers.

From Conan 1.39, a new **experimental** explicit syntax for requiring alias packages has been
introduced, designed to supersede the current one in Conan 2.0, in the form ````requires = "pkg/(latest)@user/testing"``.
Read more about it in :ref:`this section<versioning_introduction>`.
23 changes: 21 additions & 2 deletions versioning/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,27 @@ the ``pkg/latest`` package will not appear in the dependency graph at all.

This is also less deterministic, and puts the control on the package creator side, instead of
the consumer (version ranges are controlled by the consumer). Package creators can control
which real versions will their consumers be using. This is probably not the recommended way
for normal dependencies versions management.
which real versions will their consumers be using. **This is probably not the recommended way
for normal dependencies versions management.**

.. note::

From Conan 1.39, a new **experimental** syntax for requiring alias packages has been
introduced, to make explicit its usage and solve several issues with alias:

.. code-block:: python

from conans import ConanFile

class Pkg(ConanFile):
# Previous syntax, implicit, nothing in the reference tells it is an alias
# requires = "pkg/latest@user/testing"
# New experimental syntax, explicit:
requires = "pkg/(latest)@user/testing"

The new ``requires = "pkg/(latest)@user/testing"`` comes from https://github.com/conan-io/tribe/pull/25,
and is introduced in Conan 1.39 to allow getting feedback, stabilizing it, previously to make it the
default in Conan 2.0 while removing the previous one.


Package revisions
Expand Down