• Stars
    star
    7,779
  • Rank 4,883 (Top 0.1 %)
  • Language
    Python
  • License
    MIT License
  • Created about 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Conan - The open-source C and C++ package manager
JFrog | Conan 2.0 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 on 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 can 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 the same way on all platforms.
  • Integrates with any build system, including any proprietary and custom one. Provides tested support for major build systems (CMake, MSBuild, Makefiles, Meson, etc).
  • Extensible: Its Python-based recipes, together with extension points allow for great power and flexibility.
  • Large and active community, especially in GitHub (https://github.com/conan-io/conan) and Slack (https://cppalliance.org/slack/ #conan channel). This community also creates and maintains packages in ConanCenter and Bincrafters repositories in Bintray.
  • 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

Setup

You can run Conan from source in Windows, MacOS, and Linux:

  • Install pip following pip docs.

  • Clone Conan repository:

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

  • Install in editable mode

    $ cd conan-io && sudo pip install -e .

    If you are in Windows, using sudo is not required. Some Linux distros won't allow you to put Python packages in editable mode in the root Python installation, and creating a virtual environment venv first, is mandatory.

  • You are ready, try to run Conan:

    $ conan --help
    
    Consumer commands
      install    Installs the requirements specified in a recipe (conanfile.py or conanfile.txt).
      ...
    
      Conan commands. Type "conan <command> -h" for help

Contributing to the project

Feedback and contribution are always welcome in this project. Please read our contributing guide. Also, if you plan to contribute, please add some testing for your changes. You can read the Conan tests guidelines section for some advice on how to write tests for Conan.

Running the tests

Install Python requirements

$ python -m pip install -r conans/requirements_server.txt
$ python -m pip install -r conans/requirements_dev.txt

If you are not on 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=.

Conan test suite defines and configures 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.

You can run the tests like this:

$ python -m pytest .

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:

$ python -m pytest conans/test/functional/command/export_test.py::TestRevisionModeSCM::test_revision_mode_scm -s

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

Also, you can run tests against an instance of Artifactory. Those tests should add the attribute artifactory_ready.

$ python -m pytest . -m artifactory_ready

Some environment variables have to be defined to run them. For example, for an Artifactory instance that is running on the localhost with default user and password configured, the variables could take the values:

$ export CONAN_TEST_WITH_ARTIFACTORY=1
$ export ARTIFACTORY_DEFAULT_URL=http://localhost:8081/artifactory
$ export ARTIFACTORY_DEFAULT_USER=admin
$ export ARTIFACTORY_DEFAULT_PASSWORD=password

ARTIFACTORY_DEFAULT_URL is the base URL for the Artifactory repo, not one for a specific repository. Running the tests with a real Artifactory instance will create repos on the fly so please use a separate server for testing purposes.

License

MIT LICENSE

More Repositories

1

conan-center-index

Recipes for the ConanCenter repository
Python
896
star
2

cmake-conan

CMake wrapper for conan C and C++ package manager
Python
815
star
3

conan-docker-tools

Some tools for automated package generation
Dockerfile
221
star
4

conan-package-tools

Conan Package Tools. Helps with massive package creation and CI integration (Travis CI, Appveyor...)
Python
164
star
5

examples

Conan 1.x examples
Python
121
star
6

docs

conan.io reStructuredText documentation
HTML
103
star
7

conan-clion-plugin

CLion C/C++ IDE plugin for Conan Package Manager
Kotlin
98
star
8

examples2

Conan 2.x examples
Python
76
star
9

training

(Deprecated) Support code for conan 1.X trainings
Python
61
star
10

conan-vs-extension

Conan Extension for Visual Studio
C#
59
star
11

wishlist

This repo is to propose libraries, frameworks, and code in general that users would like to have in conan
49
star
12

tribe

Conan 2.0 Tribe
47
star
13

hooks

Official Conan client hooks
Python
32
star
14

conan-extensions

Some extra Conan commands for different purposes, like artifactory tasks, conan-center-index, etc
Python
24
star
15

meta-conan

Yocto layer for the Conan project
BitBake
24
star
16

hello

C++ Hello World library and application used Conan C/C++ Package Manager demos and examples
CMake
14
star
17

conan-io.github.io

Conan's Blog
HTML
11
star
18

conan_ci_jenkins

Jenkins Library for regular CI
Groovy
10
star
19

website

https://conan.io
JavaScript
9
star
20

training-ci

Material for advanced CI/CD trainings
Shell
9
star
21

web

Conan website, including home and ConanCenter
JavaScript
7
star
22

libhello

C++ Hello World library used in Conan C/C++ Package Manager tutorial and examples
C++
4
star
23

modular-boost

3
star
24

cmake-training

C++
3
star
25

test

Other test than the regular test suite, regression, tools etc.
Python
2
star
26

conanclientcert

Repository to host an updated certificate file, after LetsEncrypt expired theirs 30 Sept
2
star
27

.github

1
star
28

code-of-conduct

Code of conduct for the Conan organization
1
star
29

cci-sources-backup

Temporal solution for sources that are no longer accessible
1
star