Skip to content

Commit

Permalink
Merge branch 'develop2' into release/2.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
czoido committed Jan 12, 2023
2 parents 44ce7d6 + 4f2f8bb commit 705c743
Show file tree
Hide file tree
Showing 123 changed files with 2,420 additions and 1,413 deletions.
4 changes: 2 additions & 2 deletions .ci/jenkins/testsv2.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ void deployToPypiTest() {
def deployConan = "python -m pip install twine && " \
+ "python .ci/bump_dev_version.py && " \
+ "rm -rf dist/ && python setup.py sdist && " \
+ "python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*"
+ "python -m twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*"
sh(script: deployConan)
}
}
stage("Deploy conan-server to pypitesting") {
withCredentials([string(credentialsId: 'TWINE_USERNAME_SERVER', variable: 'TWINE_USERNAME'),
string(credentialsId: 'TWINE_PASSWORD_SERVER', variable: 'TWINE_PASSWORD')]) {
def deployServer = "rm -rf dist/ rm setup.py && mv setup_server.py setup.py && python setup.py sdist && " \
+ "python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*"
+ "python -m twine upload --verbose --repository-url https://test.pypi.org/legacy/ dist/*"
sh(script: deployServer)
}
}
Expand Down
23 changes: 0 additions & 23 deletions .codeclimate.yml

This file was deleted.

124 changes: 17 additions & 107 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Decentralized, open-source (MIT), C/C++ package manager.
- Homepage: https://conan.io/
- Github: https://github.com/conan-io/conan
- Docs: https://docs.conan.io/en/latest/
- Slack: https://cppalliance.org/slack/ (#conan channel)
- Slack: https://cpplang.slack.com (#conan channel)
- Twitter: https://twitter.com/conan_io


Expand All @@ -28,29 +28,20 @@ Conan is a package manager for C and C++ developers:
- Stable. Used in production by many companies, since 1.0 there is a commitment not to break package recipes and documented behavior.


This is the **developer/maintainer** documentation. For user documentation, go to https://docs.conan.io

+-------------------------+-------------------------+
| **develop** | **Code Climate** |
+=========================+=========================+
| |Build Status Develop| | |Develop climate| |
+-------------------------+-------------------------+

+-------------------------+
| **develop2** |
+=========================+
| |Build Status Develop| |
+-------------------------+


Setup
=====

Please read https://docs.conan.io/en/latest/installation.html to know how to
install and start using Conan. TL;DR:

.. code-block::
$ pip install conan
Install a development version
-----------------------------

You can run **Conan** client and server in Windows, MacOS, and Linux.
You can run Conan from source in Windows, MacOS, and Linux:

- **Install pip following** `pip docs`_.

Expand All @@ -60,7 +51,7 @@ You can run **Conan** client and server in Windows, MacOS, and Linux.
$ git clone https://github.com/conan-io/conan.git conan-io
NOTE: repository directory name matters, some directories are known to be problematic to run tests (e.g. `conan`). `conan-io` directory name was tested and guaranteed to be working.
NOTE: repository directory name matters, some directories are known to be problematic to run tests (e.g. `conan`). `conan-io` directory name was tested and guaranteed to be working.

- **Install in editable mode**

Expand All @@ -78,42 +69,8 @@ You can run **Conan** client and server in Windows, MacOS, and Linux.
Consumer commands
install Installs the requirements specified in a recipe (conanfile.py or conanfile.txt).
config Manages Conan configuration.
get Gets a file or list a directory of a given reference or package.
info Gets information about the dependency graph of a recipe.
search Searches package recipes and binaries in the local cache or a remote. Unless a
remote is specified only the local cache is searched.
Creator commands
new Creates a new package recipe template with a 'conanfile.py' and optionally,
'test_package' testing files.
create Builds a binary package for a recipe (conanfile.py).
upload Uploads a recipe and binary packages to a remote.
export Copies the recipe (conanfile.py & associated files) to your local cache.
export-pkg Exports a recipe, then creates a package from local source and build folders.
test Tests a package consuming it from a conanfile.py with a test() method.
Package development commands
source Calls your local conanfile.py 'source()' method.
build Calls your local conanfile.py 'build()' method.
package Calls your local conanfile.py 'package()' method.
editable Manages editable packages (packages that reside in the user workspace, but are
consumed as if they were in the cache).
workspace Manages a workspace (a set of packages consumed from the user workspace that
belongs to the same project).
Misc commands
profile Lists profiles in the '.conan/profiles' folder, or shows profile details.
remote Manages the remote list and the package recipes associated with a remote.
user Authenticates against a remote with user/pass, caching the auth token.
imports Calls your local conanfile.py or conanfile.txt 'imports' method.
copy Copies conan recipes and packages to another user/channel.
remove Removes packages or binaries matching pattern from local cache or remote.
alias Creates and exports an 'alias package recipe'.
download Downloads recipe and binaries to the local cache, without using settings.
inspect Displays conanfile attributes, like name, version, and options. Works locally,
in local cache and remote.
help Shows help for a specific command.
lock Generates and manipulates lock files.
frogarian Conan The Frogarian
...
Conan commands. Type "conan <command> -h" for help
Contributing to the project
Expand All @@ -128,28 +85,10 @@ some advise on how to write tests for Conan.
Running the tests
=================

Using tox
---------

.. code-block:: bash
$ python -m tox
It will install the needed requirements and launch `pytest` skipping some heavy and slow tests.
If you want to run the full test suite:

.. code-block:: bash
$ python -m tox -e full
Without tox
-----------

**Install python requirements**

.. code-block:: bash
$ python -m pip install -r conans/requirements.txt
$ python -m pip install -r conans/requirements_server.txt
$ python -m pip install -r conans/requirements_dev.txt
Expand All @@ -168,44 +107,18 @@ On Windows it would be (while being in the Conan root directory):
$ set PYTHONPATH=.
Ensure that your ``cmake`` has version 2.8 or later. You can see the
version with the following command:
Conan test suite defines and configure some required tools (CMake, Ninja, etc) in the
``conftest.py`` and allows to define a custom ``conftest_user.py``.
Some specific versions, like cmake>=3.15 are necessary.

.. code-block:: bash
$ cmake --version
The appropriate values of ``CONAN_COMPILER`` and ``CONAN_COMPILER_VERSION`` depend on your
operating system and your requirements.

These should work for the GCC from ``build-essential`` on Ubuntu 14.04:

.. code-block:: bash
$ export CONAN_COMPILER=gcc
$ export CONAN_COMPILER_VERSION=4.8
These should work for OS X:

.. code-block:: bash
$ export CONAN_COMPILER=clang
$ export CONAN_COMPILER_VERSION=3.5
You can run the actual tests like this:
You can run the tests like this:

.. code-block:: bash
$ python -m pytest .
There are a couple of test attributes defined, as ``slow`` that you can use
to filter the tests, and do not execute them:

.. code-block:: bash
$ python -m pytest . -m "not slow"
A few minutes later it should print ``OK``:

.. code-block:: bash
Expand Down Expand Up @@ -252,10 +165,7 @@ License
`MIT LICENSE <./LICENSE.md>`__

.. |Build Status Develop| image:: https://ci.conan.io/buildStatus/icon?job=ConanTestSuite/develop
:target: https://ci.conan.io/job/ConanTestSuite/job/develop/

.. |Develop climate| image:: https://api.codeclimate.com/v1/badges/081b53e570d5220b34e4/maintainability.svg
:target: https://codeclimate.com/github/conan-io/conan/maintainability
:target: https://ci.conan.io/blue/organizations/jenkins/ConanTestSuitev2/activity

.. |Logo| image:: https://conan.io/img/jfrog_conan_logo.png

Expand Down
29 changes: 22 additions & 7 deletions conan/api/model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from collections import OrderedDict

from conans.util.dates import timestamp_to_str


class Remote:

Expand Down Expand Up @@ -82,17 +84,30 @@ def prefs(self):

def add_prefs(self, prefs, configurations=None):
for pref in prefs:
binary_info = {} if not configurations else configurations.get(pref)
binary_info = configurations.get(pref) if configurations is not None else None
self.recipes.setdefault(pref.ref, []).append((pref, binary_info))

def serialize(self):
ret = {}
for ref, prefs in self.recipes.items():
pref_ret = {}
if prefs:
for pref, binary_info in prefs:
pref_ret[pref.repr_notime()] = binary_info
ret[ref.repr_notime()] = pref_ret
for ref, prefs in sorted(self.recipes.items()):
ref_dict = ret.setdefault(str(ref), {})
if ref.revision:
revisions_dict = ref_dict.setdefault("revisions", {})
rev_dict = revisions_dict.setdefault(ref.revision, {})
if ref.timestamp:
rev_dict["timestamp"] = timestamp_to_str(ref.timestamp)
if prefs:
packages_dict = rev_dict.setdefault("packages", {})
for pref_info in prefs:
pref, info = pref_info
pid_dict = packages_dict.setdefault(pref.package_id, {})
if info is not None:
pid_dict["info"] = info
if pref.revision:
prevs_dict = pid_dict.setdefault("revisions", {})
prev_dict = prevs_dict.setdefault(pref.revision, {})
if pref.timestamp:
prev_dict["timestamp"] = timestamp_to_str(pref.timestamp)
return ret


Expand Down
16 changes: 13 additions & 3 deletions conan/api/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,25 @@ def is_terminal(self):
return hasattr(self.stream, "isatty") and self.stream.isatty()

def writeln(self, data, fg=None, bg=None):
self.write(data, fg, bg, newline=True)
return self.write(data, fg, bg, newline=True)

def write(self, data, fg=None, bg=None, newline=False):
if conan_output_level > LEVEL_NOTICE:
return
return self
if self._color and (fg or bg):
data = "%s%s%s%s" % (fg or '', bg or '', data, Style.RESET_ALL)

if newline:
data = "%s\n" % data
self.stream.write(data)
self.stream.flush()
return self

def rewrite_line(self, line):
tmp_color = self._color
self._color = False
TOTAL_SIZE = 70
LIMIT_SIZE = 32 # Hard coded instead of TOTAL_SIZE/2-3 that fails in Py3 float division
LIMIT_SIZE = TOTAL_SIZE // 2 - 3
if len(line) > TOTAL_SIZE:
line = line[0:LIMIT_SIZE] + " ... " + line[-LIMIT_SIZE:]
self.write("\r%s%s" % (line, " " * (TOTAL_SIZE - len(line))))
Expand Down Expand Up @@ -148,18 +149,22 @@ def json_encoder(_obj):
def trace(self, msg):
if log_level_allowed(LEVEL_TRACE):
self._write_message(msg, "TRACE", fg=Color.BRIGHT_WHITE)
return self

def debug(self, msg):
if log_level_allowed(LEVEL_DEBUG):
self._write_message(msg, "DEBUG")
return self

def verbose(self, msg, fg=None, bg=None):
if log_level_allowed(LEVEL_VERBOSE):
self._write_message(msg, "VERBOSE", fg=fg, bg=bg)
return self

def status(self, msg, fg=None, bg=None):
if log_level_allowed(LEVEL_STATUS):
self._write_message(msg, "STATUS", fg=fg, bg=bg)
return self

# Remove in a later refactor of all the output.info calls
info = status
Expand All @@ -168,22 +173,27 @@ def title(self, msg):
if log_level_allowed(LEVEL_NOTICE):
self._write_message("\n-------- {} --------".format(msg), "NOTICE",
fg=Color.BRIGHT_MAGENTA)
return self

def highlight(self, msg):
if log_level_allowed(LEVEL_NOTICE):
self._write_message(msg, "NOTICE", fg=Color.BRIGHT_MAGENTA)
return self

def success(self, msg):
if log_level_allowed(LEVEL_NOTICE):
self._write_message(msg, "NOTICE", fg=Color.BRIGHT_GREEN)
return self

def warning(self, msg):
if log_level_allowed(LEVEL_WARNING):
self._write_message("WARN: {}".format(msg), "WARN", Color.YELLOW)
return self

def error(self, msg):
if log_level_allowed(LEVEL_ERROR):
self._write_message("ERROR: {}".format(msg), "ERROR", Color.RED)
return self

def flush(self):
self.stream.flush()
Expand Down
Loading

0 comments on commit 705c743

Please sign in to comment.