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

Make the library available through Conan package #619

Closed
wants to merge 1 commit into from
Closed

Make the library available through Conan package #619

wants to merge 1 commit into from

Conversation

vthiery
Copy link

@vthiery vthiery commented Jun 14, 2017

This PR addresses the issue #566 by adding the conanfile.py, build.py and test_package necessary to package and test the conan package.

The version is set to 2.1.1 and will have to be bumped when releasing.

In order to test that the package works properly, simply do conan test_package in the conan folder.
In order to upload the package, follow the documentation.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.722% when pulling b6b1c44 on vthiery:add-conan-files into fd4a0ec on nlohmann:develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.722% when pulling 2648ce6 on vthiery:add-conan-files into fd4a0ec on nlohmann:develop.

@nlohmann
Copy link
Owner

In the documentation, we have the following information:

🍺 If you are using OS X and Homebrew, just type brew tap nlohmann/json and brew install nlohmann_json and you're set. If you want the bleeding edge rather than the latest release, use brew install nlohmann_json --HEAD.

If you are using the Meson Build System, then you can wrap this repo as a subproject.

How would such a line look like for Conan?

@vthiery
Copy link
Author

vthiery commented Jun 16, 2017

I guess adding this:

If you are using Conan to manage your dependencies, merely add jsonformoderncpp/x.y.z@nlohmann/stable to your conanfile.py's requires, where x.y.z is the release version you want to use.

in the README would indeed help users a lot. We could also add this comment if they are completely new to Conan:

Then, use the command conan install /path/to/conanfile.py to install the requirements and add the following lines to your CMakeLists.txt:

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

although a the documentation on conan.io already explains it all. Maybe a link to the documentation would be better?

@nlohmann
Copy link
Owner

The shorter the better. Frankly, I think a package manager is if little use for a single-header library...

@vthiery
Copy link
Author

vthiery commented Jun 16, 2017

Indeed, it's overkill for a single header-library, I agree. Nevertheless, if one package all his dependencies with Conan, having a package at hand, even for single-header libraries, allows to have a unified way to reference TPLs.

@nlohmann
Copy link
Owner

One question: Can I really use any version with jsonformoderncpp/x.y.z@nlohmann/stable?

@vthiery
Copy link
Author

vthiery commented Jun 16, 2017

Assuming all the versions have been packaged up, yes. Now, do we want to package all the versions, or only a subset of them, is another question. I would go for packaging the latest as a first step, and package new versions going forward. Does it make sense?

@nlohmann
Copy link
Owner

What does "packaging" mean in this sense?

@vthiery
Copy link
Author

vthiery commented Jun 16, 2017

I actually refer to this document: http://docs.conan.io/en/latest/packaging.html

In practical, it means running the packaging procedure for the selected versions and uploading the packages on Bintray's servers. I can do it myself, manually, for the latest version, or a couple of them if that is required. If one wants to be a bit more CI aligned, it would mean adding a 'conan packaging' step in the pipeline, and package upon releases/hotfixes.

@nlohmann
Copy link
Owner

Hm. So this means every time I make a release at Github, I also need to do something to have a Conan release?

@vthiery
Copy link
Author

vthiery commented Jun 16, 2017

If one does not automatize the packaging upload in a CI pipeline, then yes, it means packaging manually every release one wants to have in a Conan package.

@nlohmann
Copy link
Owner

Then I would like not to have this in my repository as I do not plan to do this.

@vthiery
Copy link
Author

vthiery commented Jun 16, 2017

It makes some sense and as Pancir said in #566 the Conan files are usually maintained in another repository. Thanks for your feedback!

PS: I really enjoy working with your library, great work!

@nlohmann
Copy link
Owner

Thanks for your work in this PR and sorry for the inconvenience caused. I need to focus on the development and cannot provide additional service for the different package managers. It would be great if someone (@Pancir ?) could maintain such a repository, though.

@nlohmann
Copy link
Owner

Closing this PR and continue in #566.

@nlohmann nlohmann closed this Jun 16, 2017
@nlohmann nlohmann mentioned this pull request Jun 16, 2017
@vthiery
Copy link
Author

vthiery commented Jun 16, 2017

Sure! I actually packaged and maintain a couple of Conan packages already. I would be happy to create one for this library and maintain it.

@vthiery vthiery deleted the add-conan-files branch June 19, 2017 06:46
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.

3 participants