Skip to content
Open
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: 2 additions & 2 deletions .github/workflows/ci-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ jobs:

- name: Install common packages
run: |
pip install "conan==2.8.0"
pip install conan
pip install numpy
${{ matrix.container && 'sudo -u test-user' }} conan profile detect
${{ matrix.container && 'sudo -u test-user' }} conan profile show

- name: Run conan
run: |
${{ matrix.container && 'sudo -u test-user' }} git config --global --add safe.directory `pwd`
${{ matrix.container && 'sudo -u test-user' }} conan create . --build=missing -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}}
${{ matrix.container && 'sudo -u test-user' }} conan create . --update --build=missing -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}}

- name: Install test dependencies
if: matrix.os == 'ubuntu-22.04'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: |
export SDKROOT="`xcrun --show-sdk-path`"
brew update
brew uninstall cmake
brew uninstall cmake # workaround for `Error: cmake was installed from the local/pinned tap`
brew install $(cat scripts/docs/en/deps/macos.md)
brew install clang-format
brew install lld
Expand Down
25 changes: 17 additions & 8 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from conan.tools.cmake import cmake_layout
from conan.tools.cmake import CMakeDeps
from conan.tools.cmake import CMakeToolchain
from conan.tools.files import copy
from conan.tools.files import get, copy, export_conandata_patches
from conan.tools.files import load
from conan.tools.scm import Git
from conan.tools.system import package_manager
Expand All @@ -20,7 +20,7 @@ class UserverConan(ConanFile):
name = 'userver'
description = 'The C++ Asynchronous Framework'
topics = ('framework', 'coroutines', 'asynchronous')
url = 'https://github.com/userver-framework/userver'
url = 'https://github.com/conan-io/conan-center-index'
homepage = 'https://userver.tech/'
license = 'Apache-2.0'
package_type = 'static-library'
Expand Down Expand Up @@ -91,15 +91,24 @@ class UserverConan(ConanFile):
're2/*:with_icu': True,
}

def source(self):
known_version = (self.conan_data or {}).get("sources", {}).get(self.version)
if known_version:
get(self, **known_version, strip_root=True)
else:
Git(self).clone('https://github.com/userver-framework/userver.git', target='.')

def export_sources(self):
git = Git(self)
tracked_sources = git.included_files()
# To speed up copying, we take only the root folders
tracked_sources = set(f.split('/')[0] for f in tracked_sources)
for i in tracked_sources:
copy(self, f'{i}*', self.recipe_folder, self.export_sources_folder)
known_version = (self.conan_data or {}).get("sources", {}).get(self.version)
if known_version:
export_conandata_patches(self)
else:
pass # Running from develop branch, no patches

def set_version(self):
if self.version:
return

content = load(
self,
os.path.join(
Expand Down
Loading