Skip to main content

Conan C/C++ package manager

Project description

Logo

Conan

Decentralized, open-source (MIT), C/C++ package manager.

Conan is a package manager for C and C++ developers:

  • It is fully decentralized. Users can host their packages in their servers, privately. Integrates with Artifactory and Bintray.

  • Portable. Works across all platforms, including Linux, OSX, Windows (with native and first class support, WSL, MinGW), Solaris, FreeBSD, embedded and cross compiling, docker, WSL

  • Manage binaries. It is able to create, upload and download binaries for any configuration and platform, even cross-compiling, saving lots of time in development and continuous integration. The binary compatibility can be configured and customized. Manage all your artifacts in exactly the same way in all platforms.

  • Integrates with any build system, including any propietary and custom one. Provides tested support for major build systems (CMake, MSBuild, Makefiles, Meson, etc).

  • Extensible: Its python based recipes, together with extensions points allows for a great power and flexibility.

  • Large and active community, specially in Github (https://github.com/conan-io/conan) and Slack (https://cpplang.now.sh/ #conan channel). This community also create and maintains packages in Conan-center and Bincrafters repositories in Bintray.

  • Stable. Used in production by many companies, since 1.0 there is a committment not to break package recipes and documented behavior.

master

develop

Coverage

Build Status Master

Build Status Develop

Develop coverage

Setup

Please read https://docs.conan.io/en/latest/installation.html

From binaries

We have installers for most platforms here but you can run conan from sources if you want.

From pip

Conan is compatible with Python 2 and Python 3.

  • Install pip following pip docs.

  • Install conan:

    $ pip install conan

You can also use test.pypi.org repository to install development (non-stable) Conan versions:

$ pip install --index-url https://test.pypi.org/simple/ conan

From Homebrew (OSx)

  • Install Homebrew following brew homepage.

    $ brew update
    $ brew install conan

From source

You can run conan client and server in Windows, MacOS, and Linux.

  • Install pip following pip docs.

  • Clone conan repository:

    $ git clone https://github.com/conan-io/conan.git
  • Install in editable mode

    $ cd conan && sudo pip install -e .

    If you are in Windows, using sudo is not required.

  • You are ready, try to run conan:

    $ conan --help
    
    Consumer commands
      install    Installs the requirements specified in a conanfile (.py or .txt).
      config     Manages configuration. Edits the conan.conf or installs config files.
      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 in a remote.
    Creator commands
      new        Creates a new package recipe template with a 'conanfile.py'.
      create     Builds a binary package for recipe (conanfile.py) located in current dir.
      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 & creates a package with given files calling 'package'.
      test       Test a package, consuming it with a conanfile recipe 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.
    Misc commands
      profile    Lists profiles in the '.conan/profiles' folder, or shows profile details.
      remote     Manages the remote list and the package recipes associated to 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 recipe'.
      download   Downloads recipe and binaries to the local cache, without using settings.
    
    Conan commands. Type "conan <command> -h" for help

Contributing to the project

Feedback and contribution is always welcome in this project. Please read our contributing guide.

Running the tests

Using tox

$ tox

It will install the needed requirements and launch nose skipping some heavy and slow test. If you want to run the full test suite:

$ tox -e full

Without tox

Install python requirements

$ pip install -r conans/requirements.txt
$ pip install -r conans/requirements_server.txt
$ pip install -r conans/requirements_dev.txt

Only in OSX:

$ pip install -r conans/requirements_osx.txt # You can omit this one if not running OSX

If you are not Windows and you are not using a python virtual environment, you will need to run these commands using sudo.

Before you can run the tests, you need to set a few environment variables first.

$ export PYTHONPATH=$PYTHONPATH:$(pwd)

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:

$ 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:

$ export CONAN_COMPILER=gcc
$ export CONAN_COMPILER_VERSION=4.8

These should work for OS X:

$ export CONAN_COMPILER=clang
$ export CONAN_COMPILER_VERSION=3.5

Finally, there are some tests that use conan to package Go-lang libraries, so you might need to install go-lang in your computer and add it to the path.

You can run the actual tests like this:

$ nosetests .

There are a couple of test attributes defined, as slow, or golang that you can use to filter the tests, and do not execute them:

$ nosetests . -a !golang

A few minutes later it should print OK:

............................................................................................
----------------------------------------------------------------------
Ran 146 tests in 50.993s

OK

To run specific tests, you can specify the test name too, something like:

$ nosetests conans.test.command.config_install_test:ConfigInstallTest.install_file_test --nocapture

The --nocapture argument can be useful to see some output that otherwise is captured by nosetests.

License

MIT LICENSE

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conan-1.16.1.dev1574067531.tar.gz (520.8 kB view details)

Uploaded Source

File details

Details for the file conan-1.16.1.dev1574067531.tar.gz.

File metadata

  • Download URL: conan-1.16.1.dev1574067531.tar.gz
  • Upload date:
  • Size: 520.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for conan-1.16.1.dev1574067531.tar.gz
Algorithm Hash digest
SHA256 c44fdbb2d6e9edcee9fd3351155cf48ddb1f40eb2f8df6460886dec7f692a131
MD5 d804721a728deb15f70f20ebcd27a1cd
BLAKE2b-256 aaa5f309772aac2ceec000fe3583b2f1089bba8245bc46a7f50fab452f8a1cb2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page