Skip to content

Commit f3532d2

Browse files
authored
Merge branch 'master' into hook/custom-attributes
2 parents 6a5a89b + 36eafb1 commit f3532d2

34 files changed

+2366
-981
lines changed

.ci/Jenkinsfile

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
pipeline {
2+
agent none
3+
stages {
4+
stage("Windows") {
5+
failFast true
6+
parallel {
7+
stage('Windows - py36') {
8+
agent {
9+
label 'Windows'
10+
}
11+
stages {
12+
stage('Windows - py36 - Generate environment') {
13+
environment {
14+
PYVER = 'py36'
15+
}
16+
steps {
17+
bat '.ci/generate_env_windows.bat'
18+
}
19+
}
20+
stage('Windows - py36 - conancurrent') {
21+
environment {
22+
TOXENV = 'py36-conancurrent'
23+
}
24+
steps {
25+
bat 'tox --recreate'
26+
}
27+
}
28+
stage('Windows - py36 - conanprev') {
29+
environment {
30+
TOXENV = 'py36-conanprev'
31+
}
32+
steps {
33+
bat 'tox --recreate'
34+
}
35+
}
36+
}
37+
}
38+
stage('Windows - py39') {
39+
agent {
40+
label 'Windows'
41+
}
42+
stages {
43+
stage('Windows - py39 - Generate environment') {
44+
environment {
45+
PYVER = 'py39'
46+
}
47+
steps {
48+
bat '.ci/generate_env_windows.bat'
49+
}
50+
}
51+
stage('Windows - py39 - conancurrent') {
52+
environment {
53+
TOXENV = 'py39-conancurrent'
54+
}
55+
steps {
56+
bat 'tox --recreate'
57+
}
58+
}
59+
stage('Windows - py39 - conanprev') {
60+
environment {
61+
TOXENV = 'py39-conanprev'
62+
}
63+
steps {
64+
bat 'tox --recreate'
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
stage("Linux") {
72+
failFast true
73+
parallel {
74+
stage('Linux - py36') {
75+
agent {
76+
label 'Linux'
77+
}
78+
stages {
79+
stage('Linux - py36 - Generate environment') {
80+
environment {
81+
PYVER = 'py36'
82+
}
83+
steps {
84+
sh '.ci/generate_env_linux.sh'
85+
}
86+
}
87+
stage('Linux - py36 - conandev') {
88+
environment {
89+
TOXENV = 'py36-conandev'
90+
}
91+
steps {
92+
sh '''
93+
eval "$(pyenv init -)"
94+
pyenv activate conan
95+
tox
96+
'''
97+
}
98+
}
99+
stage('Linux - py36 - conancurrent') {
100+
environment {
101+
TOXENV = 'py36-conancurrent'
102+
}
103+
steps {
104+
sh '''
105+
eval "$(pyenv init -)"
106+
pyenv activate conan
107+
tox
108+
'''
109+
}
110+
}
111+
}
112+
}
113+
stage('Linux - py39') {
114+
agent {
115+
label 'Linux'
116+
}
117+
stages {
118+
stage('Linux - py39 - Generate environment') {
119+
environment {
120+
PYVER = 'py39'
121+
}
122+
steps {
123+
sh '.ci/generate_env_linux.sh'
124+
}
125+
}
126+
stage('Linux - py39 - conandev') {
127+
environment {
128+
TOXENV = 'py39-conandev'
129+
}
130+
steps {
131+
sh '''
132+
eval "$(pyenv init -)"
133+
pyenv activate conan
134+
tox
135+
'''
136+
}
137+
}
138+
stage('Linux - py39 - conancurrent') {
139+
environment {
140+
TOXENV = 'py39-conancurrent'
141+
}
142+
steps {
143+
sh '''
144+
eval "$(pyenv init -)"
145+
pyenv activate conan
146+
tox
147+
'''
148+
}
149+
}
150+
stage('Linux - py39 - conanprev') {
151+
environment {
152+
TOXENV = 'py39-conanprev'
153+
}
154+
steps {
155+
sh '''
156+
eval "$(pyenv init -)"
157+
pyenv activate conan
158+
tox
159+
'''
160+
}
161+
}
162+
stage('Linux - py39 - conanprevprev') {
163+
environment {
164+
TOXENV = 'py39-conanprevprev'
165+
}
166+
steps {
167+
sh '''
168+
eval "$(pyenv init -)"
169+
pyenv activate conan
170+
tox
171+
'''
172+
}
173+
}
174+
}
175+
}
176+
}
177+
}
178+
}
179+
}

.ci/generate_env_linux.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
eval "$(pyenv init -)"
7+
8+
case "${PYVER}" in
9+
py36)
10+
pyenv install 3.6.12
11+
pyenv virtualenv 3.6.12 conan
12+
;;
13+
py37)
14+
pyenv install 3.7.12
15+
pyenv virtualenv 3.7.12 conan
16+
;;
17+
py38)
18+
pyenv install 3.8.6
19+
pyenv virtualenv 3.8.6 conan
20+
;;
21+
py39)
22+
pyenv install 3.9.2
23+
pyenv virtualenv 3.9.2 conan
24+
;;
25+
esac
26+
27+
pyenv activate conan
28+
python --version
29+
pip install --upgrade pip
30+
pip3 install --requirement .ci/requirements_linux.txt
31+
python .ci/last_conan_version.py

.ci/generate_env_windows.bat

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set PATH=%PATH%;C:/Python36/Scripts/
2+
pip install tox==3.7.0 tox-venv==0.3.1 requests virtualenv
3+
python .ci/last_conan_version.py
4+
5+
IF "%PYVER%"=="py39" (
6+
set PYVER="Python39"
7+
)
8+
IF "%PYVER%"=="py38" (
9+
set PYVER="Python38-64"
10+
)
11+
IF "%PYVER%"=="py36" (
12+
set PYVER="Python36"
13+
)
14+
set TEST_FOLDER=D:/J/t/Hooks/%BUILD_NUMBER%/%PYVER%
15+
16+
virtualenv --python "C:/%PYVER%/python.exe" %TEST_FOLDER% && %TEST_FOLDER%/Scripts/activate && python --version
17+
python -m pip install pip --upgrade

.ci/last_conan_version.py

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import requests
2+
import json
3+
import sys
4+
import os
5+
6+
URL = 'https://pypi.python.org/pypi/{package}/json'
7+
8+
9+
def get_conan_version():
10+
url = URL.format(package='conan')
11+
response = requests.get(url).text
12+
version = json.loads(response)['info']['version']
13+
sys.stdout.write("Last Conan version found: {}\n".format(version))
14+
return version
15+
16+
17+
def update_tox(last_version):
18+
conan_prev = 'conan>={major}.{minor_prev},<{major}.{minor}'
19+
conan_prev_prev = 'conan>={major}.{minor_prev_prev},<{major}.{minor_prev}'
20+
21+
major, minor, _ = last_version.split('.')
22+
minor_prev = str(int(minor)-1)
23+
minor_prev_prev = str(int(minor)-2)
24+
25+
conan_prev = conan_prev.format(major=major, minor=minor, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev)
26+
conan_prev_prev = conan_prev_prev.format(major=major, minor=minor, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev)
27+
sys.stdout.write(" - prev is {major}.{minor_prev}\n".format(major=major, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev))
28+
sys.stdout.write(" - prevprev is {major}.{minor_prev_prev}\n".format(major=major, minor_prev=minor_prev, minor_prev_prev=minor_prev_prev))
29+
30+
# Replace in 'tox.ini' file
31+
tox_file = os.path.join(os.path.dirname(__file__), '..', 'tox.ini')
32+
with open(tox_file, 'r') as f:
33+
content = f.read()
34+
35+
assert 'conanprev: conan-unknown' in content, "Unexpected tox.ini content"
36+
assert 'conanprevprev: conan-unknown' in content, "Unexpected tox.ini content"
37+
38+
content = content.replace('conanprev: conan-unknown', 'conanprev: {}'.format(conan_prev))
39+
content = content.replace('conanprevprev: conan-unknown', 'conanprevprev: {}'.format(conan_prev_prev))
40+
41+
with open(tox_file, 'w') as f:
42+
f.write(content)
43+
44+
45+
46+
if __name__ == '__main__':
47+
v = get_conan_version()
48+
update_tox(v)

.ci/requirements_linux.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tox
2+
tox-venv
3+
requests

.travis.yml

-101
This file was deleted.

0 commit comments

Comments
 (0)