Skip to content

Commit

Permalink
Merge pull request #92 from EUDAT-B2HANDLE/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
themiszamani authored Nov 25, 2022
2 parents 2742bbc + e0f4b43 commit ff443fd
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 88 deletions.
163 changes: 79 additions & 84 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,96 +10,91 @@ pipeline {

}
stages {
stage ('Run tests for each python version') {
parallel {
stage ('Test python 3.5') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.5"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.5"
args "-u root:root"
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
stage ('Test python 3.5') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.5"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.5"
args "-u root:root"
}
stage ('Test python 3.6') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.6"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.6"
args "-u root:root"
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
stage ('Test python 3.6') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.6"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.6"
args "-u root:root"
}
stage ('Test python 3.7') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.7"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.7"
args "-u root:root"
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
stage ('Test python 3.7') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.7"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.7"
args "-u root:root"
}
stage ('Test python 3.9') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.9"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.9"
args "-u root:root"
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
stage ('Test python 3.9') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.9"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.9"
args "-u root:root"
}
stage ('Test python 3.10') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.10"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.10"
args "-u root:root"
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint-310.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
stage ('Test python 3.10') {
agent {
dockerfile {
filename "pyhandle/tests/testdockers/Dockerfile-py3.10"
dir "$PROJECT_DIR"
additionalBuildArgs "-t eudat-pyhandle:py3.10"
args "-u root:root"
}
}
}

steps {
sh '''
cd $WORKSPACE/$PROJECT_DIR/pyhandle/tests
./docker-entrypoint-310.sh coverage
'''
cobertura coberturaReportFile: '**/coverage.xml'
}
}
stage ('Deploy Docs') {
when {
changeset 'docs/source/**'
Expand Down
2 changes: 1 addition & 1 deletion pyhandle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.1.1"
__version__ = "1.2.0"
# The version as used in setup.py and docs/source/conf.py.

# IMPORTANT
Expand Down
4 changes: 2 additions & 2 deletions pyhandle/searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def __check_and_set_search_authentication(self):
if self.__user is None and self.__password is None:
LOGGER.debug(msg+' Neither username nor password were provided.')
elif self.__user is None:
LOGGER.debug(debug+' Username not provided. Password is '+str(self.__password))
LOGGER.debug(msg+' Username not provided. Password is '+str(self.__password))
else:
LOGGER.debug(debug+' Password not provided. Username is '+str(self.__user))
LOGGER.debug(msg+' Password not provided. Username is '+str(self.__user))
return False

def __check_and_set_search_url(self):
Expand Down
46 changes: 46 additions & 0 deletions pypi-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Instructions on uploading pyhandle releases to pypi

(Merret, 2022-07-21)

## Preparations:

1. Install twine: `pip install twine`
2. Create a pypirc file in your home dir: `vi ~/.pypirc` (see example below)
3. Login to pypi / test-pypi and create an API key to use for authentication,
add that API key to the .pypirc file.


## To upload a release:

1. Make sure you are on master and master is up to date.

2. Go to the directory where the `setup.py` file is located.

3. Remove the previous builds: `rm dist/pyhandle-x.y.z.tar.gz`

4. Build the next build: `python setup.py sdist`

5. Check with twine: `twine check dist/*`

6. Upload with twine: `twine upload --repository pypi dist/*`


## Example .pypirc file:

```
[distutils]
index-servers =
pypi
testpypi
[pypi]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-Jhdsfjksdfk... (api key)
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-KsdkfKJHksjdhfkjsdf... (api key)
```
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def find_version(*file_paths):
'pymysql==0.8.0 ; python_version < "3.11.0"'
],
tests_require=test_dependencies,
python_requires='>=3.6.*<3.11',
python_requires='>=3.6, <3.11',
cmdclass={'test': NoseTestCommand},
include_package_data=True
)
Expand Down

0 comments on commit ff443fd

Please sign in to comment.