Skip to content

Commit 7a3f8b5

Browse files
committed
Merge branch 'develop'
2 parents a456580 + 37c21ef commit 7a3f8b5

File tree

16 files changed

+191
-63
lines changed

16 files changed

+191
-63
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
ehthumbs.db
88
Thumbs.db
99

10+
# VS Code
11+
.vscode
12+
1013
# Jetbrains
1114
**/.idea/*
1215
!**/.idea/runConfigurations/

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

CI.Jenkinsfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
3+
def versions = [3.7, 3.8, 3.9, 3.10, 3.11]
4+
5+
def runSonnarForPythonVersion(sourceDir, ver){
6+
mySonarOpts="-Dsonar.sources=/source -Dsonar.host.url=${env.SONAR_HOST_URL} -Dsonar.login=${env.SONAR_AUTH_TOKEN}"
7+
if("${env.CHANGE_ID}" != "null"){
8+
mySonarOpts = "$mySonarOpts -Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.branch=${env.BRANCH_NAME}"
9+
} else {
10+
mySonarOpts = "$mySonarOpts -Dsonar.branch.name=${env.BRANCH_NAME}"
11+
}
12+
if ("${env.CHANGE_BRANCH}" != "null") {
13+
mySonarOpts="$mySonarOpts -Dsonar.pullrequest.base=${env.CHANGE_TARGET} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}"
14+
}
15+
16+
// Only run Sonar once.
17+
if(ver == 3.11) {
18+
sonarExec="cd /root/ && \
19+
wget -q https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip && \
20+
unzip -q sonar-scanner-cli-4.8.0.2856-linux.zip && \
21+
cd /source && \
22+
/root/sonar-scanner-4.8.0.2856-linux/bin/sonar-scanner ${mySonarOpts}"
23+
} else {
24+
sonarExec="echo Skipping Sonar for this version."
25+
}
26+
27+
sh "docker run \
28+
--pull always \
29+
--rm --volume ${sourceDir}:/source \
30+
python:${ver}-slim \
31+
bash -c \"apt-get update && \
32+
apt-get install -y wget unzip && \
33+
pip3 install tox && \
34+
cd /source && \
35+
tox && \
36+
${sonarExec}\""
37+
}
38+
39+
node ("docker-light") {
40+
def sourceDir = pwd()
41+
try {
42+
stage("Clean up") {
43+
step([$class: 'WsCleanup'])
44+
}
45+
stage("Checkout Code") {
46+
checkout scm
47+
}
48+
stage("Build & Test") {
49+
withSonarQubeEnv {
50+
51+
versions.each { ver ->
52+
runSonnarForPythonVersion(sourceDir, ver)
53+
}
54+
}
55+
}
56+
} catch (e) {
57+
currentBuild.result = "FAILED"
58+
throw e
59+
}
60+
}

DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To test changes you have made to the binding, you can use a pre-configured Docke
4747
git clone [email protected]:rosette-api/python.git
4848
cd python
4949
# Modify the binding...
50-
docker run -e API_KEY=$API_KEY -v $(pwd):/source rosetteapi/docker-python
50+
docker run -e API_KEY=$API_KEY -v $(pwd):/source rosette/docker-python
5151
```
5252

5353
Optional parameters for the `docker run` execution are:

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ node ("docker-light") {
1515
echo "${env.ALT_URL}"
1616
def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}"
1717
withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) {
18-
sh "docker pull rosetteapi/docker-python"
19-
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-python"
18+
sh "docker pull rosette/docker-python"
19+
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosette/docker-python"
2020
}
2121
}
2222
slack(true)

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
---
44

5-
[![Build Status](https://travis-ci.org/rosette-api/python.svg?branch=develop)](https://travis-ci.org/rosette-api/python)
65
[![PyPI version](https://badge.fury.io/py/rosette-api.svg)](https://badge.fury.io/py/rosette-api)
76
[![Python Versions](https://img.shields.io/pypi/pyversions/rosette-api.svg?color=dark%20green&label=Python%20Versions)](https://img.shields.io/pypi/pyversions/rosette-api.svg?color=dark%20green&label=Python%20Versions)
87

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
application:
2-
image: rosetteapi/docker-python
2+
image: rosette/docker-python
33
environment:
44
- API_KEY=$API_KEY
55
- HTTP_PROXY=http://squid:3128

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
# built documents.
5656
#
5757
# The short X.Y version.
58-
version = '1.24.0'
58+
version = '1.25.1'
5959
# The full version, including alpha/beta/rc tags.
60-
release = '1.24.0'
60+
release = '1.25.1'
6161

6262
# The language for content autogenerated by Sphinx. Refer to documentation
6363
# for a list of supported languages.

examples/address_similarity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
1818
params = AddressSimilarityParameters()
1919
params["address1"] = {"houseNumber": "1600", "road": "Pennsylvania Ave NW", "city": "Washington", "state": "DC", "postCode": "20500"}
2020
params["address2"] = "160 Pennsilvana Avenue, Washington, D.C., 20500"
21+
#params["parameters"] = {"houseNumberAddressFieldWeight": "0.9"}
2122

2223
try:
2324
return api.address_similarity(params)

examples/name_similarity.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def run(key, alt_url='https://api.rosette.com/rest/v1/'):
2020
params = NameSimilarityParameters()
2121
params["name1"] = {"text": matched_name_data1, "language": "eng", "entityType": "PERSON"}
2222
params["name2"] = {"text": matched_name_data2, "entityType": "PERSON"}
23+
#params["parameters"] = {"conflictScore": "0.9", "deletionScore": "0.2"}
24+
2325
try:
2426
return api.name_similarity(params)
2527
except RosetteException as exception:

0 commit comments

Comments
 (0)