pyconverters-cairn_xml 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyconverters_cairn_xml-0.5.2/.bumpversion.cfg +23 -0
- pyconverters_cairn_xml-0.5.2/.gitignore +128 -0
- pyconverters_cairn_xml-0.5.2/.pre-commit-config.yaml +17 -0
- pyconverters_cairn_xml-0.5.2/.readthedocs.yml +15 -0
- pyconverters_cairn_xml-0.5.2/AUTHORS.md +5 -0
- pyconverters_cairn_xml-0.5.2/CHANGELOG.md +7 -0
- pyconverters_cairn_xml-0.5.2/Dockerfile +20 -0
- pyconverters_cairn_xml-0.5.2/Jenkinsfile +322 -0
- pyconverters_cairn_xml-0.5.2/LICENSE +21 -0
- pyconverters_cairn_xml-0.5.2/PKG-INFO +92 -0
- pyconverters_cairn_xml-0.5.2/README.md +48 -0
- pyconverters_cairn_xml-0.5.2/RELEASE.md +39 -0
- pyconverters_cairn_xml-0.5.2/bumpversion.py +41 -0
- pyconverters_cairn_xml-0.5.2/docs/.gitignore +2 -0
- pyconverters_cairn_xml-0.5.2/docs/CHANGELOG.md +7 -0
- pyconverters_cairn_xml-0.5.2/docs/LICENSE +21 -0
- pyconverters_cairn_xml-0.5.2/docs/_static/.gitkeep +0 -0
- pyconverters_cairn_xml-0.5.2/docs/_templates/.gitkeep +0 -0
- pyconverters_cairn_xml-0.5.2/docs/conf.py +84 -0
- pyconverters_cairn_xml-0.5.2/docs/index.rst +9 -0
- pyconverters_cairn_xml-0.5.2/mypy.ini +6 -0
- pyconverters_cairn_xml-0.5.2/pyproject.toml +87 -0
- pyconverters_cairn_xml-0.5.2/results.xml +1 -0
- pyconverters_cairn_xml-0.5.2/setup.py +52 -0
- pyconverters_cairn_xml-0.5.2/src/pyconverters_cairn_xml/__init__.py +2 -0
- pyconverters_cairn_xml-0.5.2/src/pyconverters_cairn_xml/cairn_xml.py +228 -0
- pyconverters_cairn_xml-0.5.2/tests/data/CorpusResume_20pages&plus.json +37954 -0
- pyconverters_cairn_xml-0.5.2/tests/data/CorpusResume_20pages&plus.xml +52830 -0
- pyconverters_cairn_xml-0.5.2/tests/data/corpus_resumes_3_4_pages.json +5836 -0
- pyconverters_cairn_xml-0.5.2/tests/data/corpus_resumes_3_4_pages.xml +9547 -0
- pyconverters_cairn_xml-0.5.2/tests/data/list.txt +7 -0
- pyconverters_cairn_xml-0.5.2/tests/test_cairn_xml.py +66 -0
- pyconverters_cairn_xml-0.5.2/tox.ini +49 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[bumpversion]
|
|
2
|
+
current_version = 0.1.0.dev0
|
|
3
|
+
commit = True
|
|
4
|
+
tag = True
|
|
5
|
+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<build>\d+))?
|
|
6
|
+
serialize =
|
|
7
|
+
{major}.{minor}.{patch}.{release}{build}
|
|
8
|
+
{major}.{minor}.{patch}
|
|
9
|
+
|
|
10
|
+
[bumpversion:part:release]
|
|
11
|
+
optional_value = prod
|
|
12
|
+
first_value = dev
|
|
13
|
+
values =
|
|
14
|
+
dev
|
|
15
|
+
prod
|
|
16
|
+
|
|
17
|
+
[bumpversion:part:build]
|
|
18
|
+
|
|
19
|
+
[bumpversion:file:pyconverters_cairn_xml/__init__.py]
|
|
20
|
+
|
|
21
|
+
[bumpversion:file:CHANGELOG.md]
|
|
22
|
+
search = ## [unreleased]
|
|
23
|
+
replace = ## [{new_version}]
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
.idea/
|
|
30
|
+
.idea/*.*
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Flask stuff:
|
|
67
|
+
instance/
|
|
68
|
+
.webassets-cache
|
|
69
|
+
|
|
70
|
+
# Scrapy stuff:
|
|
71
|
+
.scrapy
|
|
72
|
+
|
|
73
|
+
# Sphinx documentation
|
|
74
|
+
docs/_build/
|
|
75
|
+
|
|
76
|
+
# PyBuilder
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
.python-version
|
|
88
|
+
|
|
89
|
+
# pipenv
|
|
90
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
91
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
92
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
93
|
+
# install all needed dependencies.
|
|
94
|
+
#Pipfile.lock
|
|
95
|
+
|
|
96
|
+
# celery beat schedule file
|
|
97
|
+
celerybeat-schedule
|
|
98
|
+
|
|
99
|
+
# SageMath parsed files
|
|
100
|
+
*.sage.py
|
|
101
|
+
|
|
102
|
+
# Environments
|
|
103
|
+
.env
|
|
104
|
+
.venv
|
|
105
|
+
env/
|
|
106
|
+
venv/
|
|
107
|
+
ENV/
|
|
108
|
+
env.bak/
|
|
109
|
+
venv.bak/
|
|
110
|
+
/default
|
|
111
|
+
|
|
112
|
+
# Spyder project settings
|
|
113
|
+
.spyderproject
|
|
114
|
+
.spyproject
|
|
115
|
+
|
|
116
|
+
# Rope project settings
|
|
117
|
+
.ropeproject
|
|
118
|
+
|
|
119
|
+
# mkdocs documentation
|
|
120
|
+
/site
|
|
121
|
+
|
|
122
|
+
# mypy
|
|
123
|
+
.mypy_cache/
|
|
124
|
+
.dmypy.json
|
|
125
|
+
dmypy.json
|
|
126
|
+
|
|
127
|
+
# Pyre type checker
|
|
128
|
+
.pyre/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/ambv/black
|
|
3
|
+
rev: 19.3b0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: black
|
|
6
|
+
language_version: python3.8
|
|
7
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
8
|
+
rev: v2.1.0
|
|
9
|
+
hooks:
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
exclude: '.bumpversion.cfg'
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
exclude: '.bumpversion.cfg'
|
|
14
|
+
- repo: https://gitlab.com/pycqa/flake8
|
|
15
|
+
rev: 3.7.9
|
|
16
|
+
hooks:
|
|
17
|
+
- id: flake8
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [unreleased]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
FROM python:3.8-slim-buster
|
|
2
|
+
# Install prerequisites
|
|
3
|
+
RUN apt-get update -y && \
|
|
4
|
+
apt-get install -y \
|
|
5
|
+
patch \
|
|
6
|
+
ffmpeg \
|
|
7
|
+
gcc && \
|
|
8
|
+
apt-get install -y --no-install-recommends \
|
|
9
|
+
g++ \
|
|
10
|
+
git && \
|
|
11
|
+
# Final upgrade + clean
|
|
12
|
+
apt-get update -y && \
|
|
13
|
+
apt-get clean all -y
|
|
14
|
+
|
|
15
|
+
# Enable Installing packages as root
|
|
16
|
+
ENV FLIT_ROOT_INSTALL=1
|
|
17
|
+
|
|
18
|
+
# Add pyproject.toml + README.md for flit install
|
|
19
|
+
ADD pyproject.toml pyproject.toml
|
|
20
|
+
ADD README.md README.md
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
pipeline {
|
|
2
|
+
|
|
3
|
+
environment {
|
|
4
|
+
PATH_HOME = "/home/jenkins"
|
|
5
|
+
PYTHONDONTWRITEBYTECODE = "1"
|
|
6
|
+
PYTHONPYCACHEPREFIX = "/tmp/.pytest_cache"
|
|
7
|
+
TEST_REPORT_DIR="/root/test-reports"
|
|
8
|
+
MAJOR_VERSION = "0"
|
|
9
|
+
MINOR_VERSION = "5"
|
|
10
|
+
GIT_AUTH = credentials('bitbucket-user')
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
agent none
|
|
14
|
+
|
|
15
|
+
triggers {
|
|
16
|
+
upstream(upstreamProjects: "pymultirole_plugins/" + env.BRANCH_NAME.replaceAll("/", "%2F"),\
|
|
17
|
+
threshold: hudson.model.Result.SUCCESS)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
parameters {
|
|
21
|
+
booleanParam(defaultValue: false, description: 'if set to true (ticked), it will not skip on CI commit', name: 'forcePublishing')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
stages {
|
|
25
|
+
|
|
26
|
+
stage('Catch build termination') {
|
|
27
|
+
agent {
|
|
28
|
+
node {
|
|
29
|
+
label 'built-in'
|
|
30
|
+
customWorkspace "/home/jenkins/${env.JOB_NAME}"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
stages {
|
|
34
|
+
stage('Abort if upstream or CI_commit') {
|
|
35
|
+
steps {
|
|
36
|
+
script {
|
|
37
|
+
abortBuild()
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
stage('Generate new version') {
|
|
45
|
+
agent {
|
|
46
|
+
node {
|
|
47
|
+
label 'built-in'
|
|
48
|
+
customWorkspace "/home/jenkins/${env.JOB_NAME}"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
stages {
|
|
53
|
+
|
|
54
|
+
stage('Add credentials') {
|
|
55
|
+
steps {
|
|
56
|
+
script {
|
|
57
|
+
// Add password file for flit publishing
|
|
58
|
+
sh "cp ${env.PATH_HOME}/.passwd-pypi .env"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
stage('Skip on CI commit') {
|
|
64
|
+
steps {
|
|
65
|
+
script {
|
|
66
|
+
// returnStatus = 1 when string not found -> Team commit
|
|
67
|
+
// returnStatus = 0 when string is found -> CI commit
|
|
68
|
+
env.LAST_COMMIT_IS_TEAM = sh(
|
|
69
|
+
script: 'git log -1 | grep "\\[Jenkins CI\\]"',
|
|
70
|
+
returnStatus: true
|
|
71
|
+
)
|
|
72
|
+
if (LAST_COMMIT_IS_TEAM == '0') {
|
|
73
|
+
println "Last commit has been done by CI, skipping next steps"
|
|
74
|
+
} else {
|
|
75
|
+
println "Last commit has been done by Team, processing"
|
|
76
|
+
}
|
|
77
|
+
if (params.forcePublishing) {
|
|
78
|
+
println "Try to publish, considering last commit has been done by Team"
|
|
79
|
+
env.LAST_COMMIT_IS_TEAM = "1"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
stage('Commit new version') {
|
|
86
|
+
when {
|
|
87
|
+
environment name: "LAST_COMMIT_IS_TEAM", value: "1"
|
|
88
|
+
}
|
|
89
|
+
steps {
|
|
90
|
+
script {
|
|
91
|
+
println("attempt to publish ${env.JOB_NAME} with version: ${MAJOR_VERSION}.${MINOR_VERSION}.${env.BUILD_ID}")
|
|
92
|
+
|
|
93
|
+
// push updates of file __init__.py
|
|
94
|
+
withCredentials([gitUsernamePassword(credentialsId: 'bitbucket-user', gitToolName: 'git-tool')]) {
|
|
95
|
+
sh "echo '\"\"\"Cairn.info XML converter.\"\"\"' > src/pyconverters_cairn_xml/__init__.py"
|
|
96
|
+
sh "echo '__version__ = \"${MAJOR_VERSION}.${MINOR_VERSION}.${env.BUILD_ID}\"' >> src/pyconverters_cairn_xml/__init__.py"
|
|
97
|
+
sh 'git commit src/pyconverters_cairn_xml/__init__.py -m "[Jenkins CI] Commit on version files" || echo "No changes to commit"'
|
|
98
|
+
sh 'git push'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
stage('Build, test and publish') {
|
|
108
|
+
when {
|
|
109
|
+
environment name: "LAST_COMMIT_IS_TEAM", value: "1"
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
agent {
|
|
113
|
+
// dockerfile agent
|
|
114
|
+
// Mounted volume for Junit reports
|
|
115
|
+
// - docker: /root/test-reports
|
|
116
|
+
// - host : /tmp/_${env.JOB_NAME}/test-reports
|
|
117
|
+
dockerfile {
|
|
118
|
+
label 'built-in'
|
|
119
|
+
customWorkspace "/home/jenkins/${env.JOB_NAME}"
|
|
120
|
+
filename 'Dockerfile'
|
|
121
|
+
args "-u root --privileged -v /tmp/_${env.JOB_NAME}/test-reports:${TEST_REPORT_DIR}"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
stages {
|
|
126
|
+
|
|
127
|
+
stage('Install flit & flake8') {
|
|
128
|
+
steps {
|
|
129
|
+
// remove any previous tox env
|
|
130
|
+
sh 'rm -rf .tox'
|
|
131
|
+
sh 'python -m pip install pip==22.0.3'
|
|
132
|
+
sh 'pip install --no-cache-dir flit==3.2.0 flake8==3.9.2 flakehell tox'
|
|
133
|
+
sh 'flit install'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
stage('Test & lint python code') {
|
|
138
|
+
steps {
|
|
139
|
+
// remove any previous results.xml file
|
|
140
|
+
sh "rm -f ${TEST_REPORT_DIR}/results.xml"
|
|
141
|
+
sh 'tox'
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
stage('Publish on PyPI') {
|
|
146
|
+
environment {
|
|
147
|
+
FLIT_USERNAME = getUserName ".env"
|
|
148
|
+
FLIT_PASSWORD = getUserPass ".env"
|
|
149
|
+
}
|
|
150
|
+
steps {
|
|
151
|
+
// remove any previous folder dist
|
|
152
|
+
sh 'rm -rf dist'
|
|
153
|
+
// create (as root) folder dist
|
|
154
|
+
sh 'mkdir dist'
|
|
155
|
+
// pull recent updates of file __init__.py
|
|
156
|
+
withCredentials([gitUsernamePassword(credentialsId: 'bitbucket-user', gitToolName: 'git-tool')]) {
|
|
157
|
+
sh 'git config --global pull.rebase false'
|
|
158
|
+
sh "git config --global --add safe.directory ${PATH_HOME}/${env.JOB_NAME}"
|
|
159
|
+
sh 'git pull'
|
|
160
|
+
}
|
|
161
|
+
// put back owner of pulled file
|
|
162
|
+
sh 'chown 1000:1000 src/pyconverters_cairn_xml/__init__.py'
|
|
163
|
+
// get git status
|
|
164
|
+
sh 'git status'
|
|
165
|
+
// publish on PyPI
|
|
166
|
+
sh 'flit publish'
|
|
167
|
+
// remove current folder dist
|
|
168
|
+
sh 'rm -rf dist'
|
|
169
|
+
// remove current folder .hypothesis
|
|
170
|
+
sh 'rm -rf .hypothesis'
|
|
171
|
+
// remove current folder .tox
|
|
172
|
+
sh 'rm -rf .tox'
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
post {
|
|
183
|
+
// only triggered when blue or green sign
|
|
184
|
+
success {
|
|
185
|
+
// node is specified here to get an agent
|
|
186
|
+
node('built-in') {
|
|
187
|
+
// keep using customWorkspace to store Junit report
|
|
188
|
+
ws("/home/jenkins/${env.JOB_NAME}") {
|
|
189
|
+
script {
|
|
190
|
+
try {
|
|
191
|
+
sh "rm -f results.xml"
|
|
192
|
+
sh "cp /tmp/_${env.JOB_NAME}/test-reports/results.xml results.xml"
|
|
193
|
+
} catch (Exception e) {
|
|
194
|
+
echo 'Exception occurred: ' + e.toString()
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
junit 'results.xml'
|
|
198
|
+
} catch (Exception e) {
|
|
199
|
+
echo 'Exception occurred: ' + e.toString()
|
|
200
|
+
}
|
|
201
|
+
println "sending Systematic Build notification"
|
|
202
|
+
emailext(body: '${DEFAULT_CONTENT}', mimeType: 'text/html',
|
|
203
|
+
replyTo: '${DEFAULT_REPLYTO}', subject: '${DEFAULT_SUBJECT}',
|
|
204
|
+
to: '${DEFAULT_RECIPIENTS}')
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// triggered when red sign
|
|
210
|
+
failure {
|
|
211
|
+
// node is specified here to get an agent
|
|
212
|
+
node('built-in') {
|
|
213
|
+
// keep using customWorkspace to store Junit report
|
|
214
|
+
ws("/home/jenkins/${env.JOB_NAME}") {
|
|
215
|
+
script {
|
|
216
|
+
try {
|
|
217
|
+
sh "rm -f results.xml"
|
|
218
|
+
sh "cp /tmp/_${env.JOB_NAME}/test-reports/results.xml results.xml"
|
|
219
|
+
} catch (Exception e) {
|
|
220
|
+
echo 'Exception occurred: ' + e.toString()
|
|
221
|
+
}
|
|
222
|
+
try {
|
|
223
|
+
junit 'results.xml'
|
|
224
|
+
} catch (Exception e) {
|
|
225
|
+
echo 'Exception occurred: ' + e.toString()
|
|
226
|
+
}
|
|
227
|
+
println "sending Systematic Build notification"
|
|
228
|
+
emailext(body: '${DEFAULT_CONTENT}', mimeType: 'text/html',
|
|
229
|
+
replyTo: '${DEFAULT_REPLYTO}', subject: '${DEFAULT_SUBJECT}',
|
|
230
|
+
to: '${DEFAULT_RECIPIENTS}')
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// trigger every-works
|
|
236
|
+
//always {
|
|
237
|
+
//}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// return FLIT_USERNAME from given file
|
|
243
|
+
def getUserName(path) {
|
|
244
|
+
USERNAME = sh(
|
|
245
|
+
script: "grep FLIT_USERNAME ${path}|cut -d '=' -f2",
|
|
246
|
+
returnStdout: true
|
|
247
|
+
).trim()
|
|
248
|
+
return USERNAME
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// return FLIT_PASSWORD from given file
|
|
252
|
+
def getUserPass(path) {
|
|
253
|
+
USERPASS = sh(
|
|
254
|
+
script: "grep FLIT_PASSWORD ${path}|cut -d '=' -f2",
|
|
255
|
+
returnStdout: true
|
|
256
|
+
).trim()
|
|
257
|
+
return USERPASS
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
def abortBuild() {
|
|
261
|
+
def upstream_projects = ["pymultirole_plugins"]
|
|
262
|
+
def upstream_running = null
|
|
263
|
+
def jobName
|
|
264
|
+
// iterate over upstream_projects
|
|
265
|
+
for (upstream_project in upstream_projects) {
|
|
266
|
+
Jenkins.instance.getItemByFullName(upstream_project).getItems().each { repository ->
|
|
267
|
+
def isRunning = false
|
|
268
|
+
//repository.parent.name: project
|
|
269
|
+
//repository.name: branch
|
|
270
|
+
if ( repository.name == env.BRANCH_NAME ) {
|
|
271
|
+
// iterate over all jobs of current repository
|
|
272
|
+
repository.getAllJobs().each { job ->
|
|
273
|
+
// iterate over all builds of current job
|
|
274
|
+
job.builds.each { build ->
|
|
275
|
+
// determine if a build is running or not
|
|
276
|
+
if ( build.getResult().equals(null) ) {
|
|
277
|
+
jobName = build.parent.parent.name
|
|
278
|
+
isRunning = true
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if ( isRunning ) {
|
|
282
|
+
upstream_running = true
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// Abort build when upstream detected
|
|
289
|
+
if (upstream_running != null) {
|
|
290
|
+
println 'Aborting build because upstream job detected (' + jobName + ')'
|
|
291
|
+
currentBuild.result = 'ABORTED'
|
|
292
|
+
currentBuild.getRawBuild().getExecutor().interrupt(Result.ABORTED)
|
|
293
|
+
sleep(1) // Interrupt is not blocking and does not take effect immediately.
|
|
294
|
+
}
|
|
295
|
+
// Abort build when last commit is CI commit
|
|
296
|
+
// returnStatus = 1 when string not found -> Team commit
|
|
297
|
+
// returnStatus = 0 when string is found -> CI commit
|
|
298
|
+
def last_commit_is_team = sh(
|
|
299
|
+
script: 'git log -1 | grep "\\[Jenkins CI\\]"',
|
|
300
|
+
returnStatus: true
|
|
301
|
+
)
|
|
302
|
+
if (params.forcePublishing) {
|
|
303
|
+
println "Try to publish, proceeding"
|
|
304
|
+
last_commit_is_team = 1
|
|
305
|
+
}
|
|
306
|
+
def isStartedByUser = currentBuild.rawBuild.getCause(hudson.model.Cause$UserIdCause) != null
|
|
307
|
+
if (isStartedByUser) {
|
|
308
|
+
println "Job started by User, proceeding"
|
|
309
|
+
last_commit_is_team = 1
|
|
310
|
+
}
|
|
311
|
+
def isStartedByUpstream = currentBuild.rawBuild.getCause(hudson.model.Cause$UpstreamCause) != null
|
|
312
|
+
if (isStartedByUpstream) {
|
|
313
|
+
println "Job started by Upstream, proceeding"
|
|
314
|
+
last_commit_is_team = 1
|
|
315
|
+
}
|
|
316
|
+
if (last_commit_is_team == 0) {
|
|
317
|
+
println 'Aborting build because last commit has been done by CI'
|
|
318
|
+
currentBuild.result = 'ABORTED'
|
|
319
|
+
currentBuild.getRawBuild().getExecutor().interrupt(Result.ABORTED)
|
|
320
|
+
sleep(1) // Interrupt is not blocking and does not take effect immediately.
|
|
321
|
+
}
|
|
322
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Olivier Terrier
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: pyconverters-cairn_xml
|
|
3
|
+
Version: 0.5.2
|
|
4
|
+
Summary: Cairn.info XML converter.
|
|
5
|
+
Home-page: https://github.com/oterrier/pyconverters_cairn_xml/
|
|
6
|
+
Keywords:
|
|
7
|
+
Author: Olivier Terrier
|
|
8
|
+
Author-email: olivier.terrier@kairntech.com
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Classifier: Intended Audience :: Information Technology
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Topic :: Software Development
|
|
19
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
20
|
+
Classifier: Development Status :: 4 - Beta
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
+
Requires-Dist: pymultirole-plugins>=0.5.0,<0.6.0
|
|
23
|
+
Requires-Dist: lxml
|
|
24
|
+
Requires-Dist: beautifulsoup4
|
|
25
|
+
Requires-Dist: inscriptis==1.2
|
|
26
|
+
Requires-Dist: flit ; extra == "dev"
|
|
27
|
+
Requires-Dist: pre-commit ; extra == "dev"
|
|
28
|
+
Requires-Dist: bump2version ; extra == "dev"
|
|
29
|
+
Requires-Dist: sphinx ; extra == "docs"
|
|
30
|
+
Requires-Dist: sphinx-rtd-theme ; extra == "docs"
|
|
31
|
+
Requires-Dist: m2r2 ; extra == "docs"
|
|
32
|
+
Requires-Dist: sphinxcontrib.apidoc ; extra == "docs"
|
|
33
|
+
Requires-Dist: jupyter_sphinx ; extra == "docs"
|
|
34
|
+
Requires-Dist: pytest>=7.1.0 ; extra == "test"
|
|
35
|
+
Requires-Dist: pytest-cov ; extra == "test"
|
|
36
|
+
Requires-Dist: pytest-flake8 ; extra == "test"
|
|
37
|
+
Requires-Dist: pytest-black ; extra == "test"
|
|
38
|
+
Requires-Dist: flake8==3.9.2 ; extra == "test"
|
|
39
|
+
Requires-Dist: tox ; extra == "test"
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Provides-Extra: docs
|
|
42
|
+
Provides-Extra: test
|
|
43
|
+
|
|
44
|
+
# pyconverters_cairn_xml
|
|
45
|
+
|
|
46
|
+
[](https://github.com/oterrier/pyconverters_cairn_xml/blob/master/LICENSE)
|
|
47
|
+
[](https://github.com/oterrier/pyconverters_cairn_xml/actions?query=workflow%3Atests)
|
|
48
|
+
[](https://codecov.io/gh/oterrier/pyconverters_cairn_xml)
|
|
49
|
+
[](https://pyconverters_cairn_xml.readthedocs.io)
|
|
50
|
+
[](https://pypi.org/project/pyconverters_cairn_xml/)
|
|
51
|
+
[](https://pypi.org/project/pyconverters_cairn_xml/)
|
|
52
|
+
|
|
53
|
+
Fetch articles from Pubmed
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
You can simply `pip install pyconverters_cairn_xml`.
|
|
58
|
+
|
|
59
|
+
## Developing
|
|
60
|
+
|
|
61
|
+
### Pre-requesites
|
|
62
|
+
|
|
63
|
+
You will need to install `flit` (for building the package) and `tox` (for orchestrating testing and documentation building):
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
python3 -m pip install flit tox
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Clone the repository:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
git clone https://github.com/oterrier/pyconverters_cairn_xml
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Running the test suite
|
|
76
|
+
|
|
77
|
+
You can run the full test suite against all supported versions of Python (3.8) with:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
tox
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Building the documentation
|
|
84
|
+
|
|
85
|
+
You can build the HTML documentation with:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
tox -e docs
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The built documentation is available at `docs/_build/index.html.
|
|
92
|
+
|