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

[conan-center] Conan v2 support: part II #514

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8157639
Conan 2.x with hooks - firsts steps
uilianries Oct 3, 2023
baf7a6a
Updatem more hooks
uilianries Oct 4, 2023
4188663
Updatem more hooks
uilianries Oct 4, 2023
cc5a66b
Update tests
uilianries Oct 4, 2023
fc56f62
add more test
uilianries Oct 4, 2023
201d3b3
fix regex
uilianries Oct 4, 2023
50ce997
add test for kb-h003
uilianries Oct 5, 2023
1fdae44
Add more tests
uilianries Oct 5, 2023
60658db
test kb-h008
uilianries Oct 5, 2023
d90b164
test kb-h009
uilianries Oct 5, 2023
09ce9e3
test kb-h10
uilianries Oct 5, 2023
3ab9104
add more tests
uilianries Oct 5, 2023
081e393
more tests
uilianries Oct 5, 2023
d3e0803
add more test
uilianries Oct 5, 2023
c1bb833
add test for h019
uilianries Oct 5, 2023
a9de68d
add test for h020
uilianries Oct 5, 2023
a4c7dfc
Add more tests
uilianries Oct 5, 2023
6d04cbd
add more tests
uilianries Oct 5, 2023
21369e4
more tests
uilianries Oct 5, 2023
8110abd
more tests
uilianries Oct 5, 2023
9456a07
add mote tests
uilianries Oct 5, 2023
b88ea36
Add more test
uilianries Oct 5, 2023
4b10a19
Add more tests
uilianries Oct 5, 2023
b563264
Update setup
uilianries Oct 5, 2023
4ce28e3
Fix h011
uilianries Oct 6, 2023
8385d56
update tests
uilianries Oct 6, 2023
ad2dab1
fix tests
uilianries Oct 6, 2023
19d1bee
Remove print()
uilianries Oct 6, 2023
2b35fe7
Add openssh in allowlist
uilianries Oct 6, 2023
8e22247
test conanv2 in Jenkins
uilianries Oct 6, 2023
4f169e5
add back conan-center hook
uilianries Oct 6, 2023
a5eead2
update ci prev
uilianries Oct 6, 2023
0fd45ff
test linux before windows
uilianries Oct 6, 2023
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
206 changes: 157 additions & 49 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,28 @@ pipeline {
sh '.ci/run_tox.sh'
}
}
stage('Macos - py36 - conancurrent') {
stage('Macos - py36 - conanv1') {
environment {
PYVER = 'py36'
TOXENV = 'py36-conancurrent'
TOXENV = 'py36-conanv1'
}
steps {
sh '.ci/run_tox.sh'
}
}
stage('Macos - py36 - conanrel2') {
environment {
PYVER = 'py36'
TOXENV = 'py36-conanrel2'
}
steps {
sh '.ci/run_tox.sh'
}
}
stage('Macos - py36 - conanv2') {
environment {
PYVER = 'py36'
TOXENV = 'py36-conanv2'
}
steps {
sh '.ci/run_tox.sh'
Expand Down Expand Up @@ -59,64 +77,31 @@ pipeline {
sh '.ci/run_tox.sh'
}
}
stage('Macos - py38 - conancurrent') {
stage('Macos - py38 - conanv1') {
environment {
PYVER = 'py38'
TOXENV = 'py38-conancurrent'
TOXENV = 'py38-conanv1'
}
steps {
sh '.ci/run_tox.sh'
}
}
}
}
}
}
stage("Windows") {
failFast true
parallel {
stage('Windows - py36') {
agent {
label 'Windows'
}
stages {
stage('Windows - py36 - Generate environment') {
environment {
PYVER = 'py36'
}
steps {
bat '.ci/generate_env_windows.bat'
}
}
stage('Windows - py36 - conancurrent') {
environment {
TOXENV = 'py36-conancurrent'
}
steps {
bat 'tox --recreate'
}
}
}
}
stage('Windows - py38') {
agent {
label 'Windows'
}
stages {
stage('Windows - py38 - Generate environment') {
stage('Macos - py38 - conanrel2') {
environment {
PYVER = 'py38'
TOXENV = 'py38-conanrel2'
}
steps {
bat '.ci/generate_env_windows.bat'
sh '.ci/run_tox.sh'
}
}
stage('Windows - py38 - conancurrent') {
stage('Macos - py38 - conanv2') {
environment {
TOXENV = 'py38-conancurrent'
PYVER = 'py38'
TOXENV = 'py38-conanv2'
}
steps {
bat 'tox --recreate'
sh '.ci/run_tox.sh'
}
}
}
Expand Down Expand Up @@ -151,9 +136,33 @@ pipeline {
'''
}
}
stage('Linux - py36 - conancurrent') {
stage('Linux - py36 - conanv1') {
environment {
TOXENV = 'py36-conancurrent'
TOXENV = 'py36-conanv1'
}
steps {
sh '''
eval "$(pyenv init -)"
pyenv activate conan
tox
'''
}
}
stage('Linux - py36 - conanrel2') {
environment {
TOXENV = 'py36-conanrel2'
}
steps {
sh '''
eval "$(pyenv init -)"
pyenv activate conan
tox
'''
}
}
stage('Linux - py36 - conanv2') {
environment {
TOXENV = 'py36-conanv2'
}
steps {
sh '''
Expand Down Expand Up @@ -190,9 +199,33 @@ pipeline {
'''
}
}
stage('Linux - py38 - conancurrent') {
stage('Linux - py38 - conanv1') {
environment {
TOXENV = 'py38-conanv1'
}
steps {
sh '''
eval "$(pyenv init -)"
pyenv activate conan
tox
'''
}
}
stage('Linux - py38 - conanrel2') {
environment {
TOXENV = 'py38-conanrel2'
}
steps {
sh '''
eval "$(pyenv init -)"
pyenv activate conan
tox
'''
}
}
stage('Linux - py38 - conanv2') {
environment {
TOXENV = 'py38-conancurrent'
TOXENV = 'py38-conanv2'
}
steps {
sh '''
Expand All @@ -206,5 +239,80 @@ pipeline {
}
}
}
stage("Windows") {
failFast true
parallel {
stage('Windows - py36') {
agent {
label 'Windows'
}
stages {
stage('Windows - py36 - Generate environment') {
environment {
PYVER = 'py36'
}
steps {
bat '.ci/generate_env_windows.bat'
}
}
stage('Windows - py36 - conanv1') {
environment {
TOXENV = 'py36-conanv1'
}
steps {
bat 'tox --recreate'
}
}
stage('Windows - py36 - conanrel2') {
environment {
TOXENV = 'py36-conanrel2'
}
steps {
bat 'tox --recreate'
}
}
stage('Windows - py36 - conanv2') {
environment {
TOXENV = 'py36-conanv2'
}
steps {
bat 'tox --recreate'
}
}
}
}
stage('Windows - py38') {
agent {
label 'Windows'
}
stages {
stage('Windows - py38 - Generate environment') {
environment {
PYVER = 'py38'
}
steps {
bat '.ci/generate_env_windows.bat'
}
}
stage('Windows - py38 - conanv1') {
environment {
TOXENV = 'py38-conanv1'
}
steps {
bat 'tox --recreate'
}
}
stage('Windows - py38 - conanv2') {
environment {
TOXENV = 'py38-conanv2'
}
steps {
bat 'tox --recreate'
}
}
}
}
}
}
}
}
}
11 changes: 1 addition & 10 deletions .ci/last_conan_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ def update_tox(last_version):
minor_prev = str(int(minor)-1)
minor_prev_prev = str(int(minor)-2)

conan_prev = conan_prev.format(major=major, minor=minor, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev)
conan_prev_prev = conan_prev_prev.format(major=major, minor=minor, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev)
sys.stdout.write(" - prev is {major}.{minor_prev}\n".format(major=major, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev))
sys.stdout.write(" - prevprev is {major}.{minor_prev_prev}\n".format(major=major, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev))

Expand All @@ -32,17 +30,10 @@ def update_tox(last_version):
with open(tox_file, 'r') as f:
content = f.read()

assert 'conanprev: conan-unknown' in content, "Unexpected tox.ini content"
assert 'conanprevprev: conan-unknown' in content, "Unexpected tox.ini content"

content = content.replace('conanprev: conan-unknown', 'conanprev: {}'.format(conan_prev))
content = content.replace('conanprevprev: conan-unknown', 'conanprevprev: {}'.format(conan_prev_prev))

with open(tox_file, 'w') as f:
f.write(content)



if __name__ == '__main__':
v = get_conan_version()
update_tox(v)
update_tox(v)
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ If you handle multiple dependencies in your project is better to add a *conan.co

These are the hooks currently available in this repository

### [Conan Center](hooks/conan-center.py)
### [Conan Center](hooks/hook_conan_center.py)

This hook does checks for the [inclusion guidelines of third-party libraries](https://docs.conan.io/en/latest/uploading_packages/artifactory/conan_center_guide.html)
**NOTE**: This hook requires Conan 2.x

This hook does checks for the [inclusion guidelines of third-party libraries](https://docs.conan.io/2/tutorial/conan_repositories/conan_center.html)
in [Conan Center](https://conan.io/center/).

It is mostly intended for users who want to contribute packages to Conan Center. With this hook
Expand All @@ -86,17 +88,8 @@ check as ``OK``, ``WARNING`` or ``ERROR``:

If you want the hook to fail the execution, if an error is reported, you can adjust the environment
variable ``CONAN_HOOK_ERROR_LEVEL``:
- ``CONAN_HOOK_ERROR_LEVEL=40`` it will raise if any error happen.
- ``CONAN_HOOK_ERROR_LEVEL=30`` it will raise if any error or warning happen.

#### Conan 2.x support

The Conan Center hook is **NOT** supported by Conan v2 yet. Do not try to run this file with Conan v2.

There is an effort on the [disabled-hook_conan-center-v2.py](hooks/disabled-hook_conan-center-v2.py), but is not updated and should be broken by now.

The support for Conan 2.x should be rethinked first, because others items like linter and extensions should be considered too.

- ``CONAN_HOOK_ERROR_LEVEL=ERROR`` it will raise if any error happen.
- ``CONAN_HOOK_ERROR_LEVEL=WARNING`` it will raise if any error or warning happen.

### [Attribute checker](hooks/attribute_checker.py)

Expand Down Expand Up @@ -202,4 +195,4 @@ It only helps to avoid generation of extra recipe revisions in case of adding ne

## License

[MIT License](LICENSE)
[MIT License](LICENSE)
Loading