diff --git a/Jenkinsfile b/Jenkinsfile index 18e9e4d..0c52d11 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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/**' diff --git a/pyhandle/__init__.py b/pyhandle/__init__.py index 4f24ee2..c08ee3e 100644 --- a/pyhandle/__init__.py +++ b/pyhandle/__init__.py @@ -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 diff --git a/pyhandle/searcher.py b/pyhandle/searcher.py index ba64f73..e7fd5d2 100644 --- a/pyhandle/searcher.py +++ b/pyhandle/searcher.py @@ -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): diff --git a/pypi-instructions.md b/pypi-instructions.md new file mode 100644 index 0000000..d6ec179 --- /dev/null +++ b/pypi-instructions.md @@ -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) + +``` diff --git a/setup.py b/setup.py index b6a8b02..e3bd943 100644 --- a/setup.py +++ b/setup.py @@ -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 )