diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 715abba..0000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" -# - "3.7" -- this is done through the "matrix" parameter - - "nightly" -matrix: - include: - - python: 3.7 - dist: xenial - sudo: true -jobs: - allow_failures: - - python: "nightly" -install: - - pip install -U setuptools - - pip install -e . - - pip install -e .[dev] -script: - - nosetests - - coverage report -m - - python setup.py sdist bdist_wheel && pip install dist/ovh-*.tar.gz && cd /tmp && python -c 'import ovh; ovh.Client("ovh-eu").get("/auth/time", _need_auth=False)' && cd - -deploy: - provider: pypi - user: $pypiUser - password: $pypiPassword - distributions: "sdist bdist_wheel" - on: - branch: master - tags: true - python: '3.6' -after_success: - coveralls -sudo: false diff --git a/LICENSE b/LICENSE index d69128f..107af46 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2013-2018, OVH SAS. +Copyright (c) 2013-2022, OVH SAS. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.rst b/README.rst index f0ac72a..0a511d8 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ :alt: Python & OVH APIs :target: https://pypi.python.org/pypi/ovh -Lightweight wrapper around OVH's APIs. Handles all the hard work including +Lightweight wrapper around OVHcloud's APIs. Handles all the hard work including credential creation and requests signing. .. image:: https://img.shields.io/pypi/v/ovh.svg @@ -45,7 +45,7 @@ credential creation and requests signing. Installation ============ -The python wrapper works with Python 2.7 and Python 3.4+. +The python wrapper works with Python 3.6+. The easiest way to get the latest stable release is to grab it from `pypi `_ using ``pip``. @@ -60,6 +60,8 @@ Alternatively, you may get latest development version directly from Git. pip install -e git+https://github.com/ovh/python-ovh.git#egg=ovh +People looking for Python 2 compatibility should use 0.6.x version. + Example Usage ============= @@ -132,12 +134,6 @@ customer's information: .. code:: python # -*- encoding: utf-8 -*- - - try: - input = raw_input - except NameError: - pass - import ovh # create a client using configuration diff --git a/debian/changelog b/debian/changelog index 75ccdbd..4708989 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,25 @@ +python-ovh (1.0.0) master; urgency=medium + + * breaking: remove python 2 support (#110) + * feat: added compatibility for Python 3.8, 3.9, 3.10 (#108) + * feat: add headers customisation in `raw_call` (#84) + * fix: do not send JSON body when no parameter was provided (#85) + * chore: improved coverage and bump coverage library (#100) + * chore: add scripts for debian packaging (#110) + + -- Romain Beuque Tue, 15 Mar 2022 11:55:32 +0000 + +python-ovh (0.6.0) trusty; urgency=medium + + * feat: added compatibility for Python 3.7 (#80) + * feat: delete function now supports body parameters (#109) + * fix: if HTTP status is 204 No Response, do not attempt to parse response + body (#92) + * fix: query parameters None should be JSON encoded and empty query params + should not be sent (#102) + + -- Romain Beuque Tue, 15 Mar 2022 09:45:15 +0000 + python-ovh (0.5.0) trusty; urgency=medium * New upstream release v0.5.0 diff --git a/debian/control b/debian/control index 6ac1a3f..f225a3b 100644 --- a/debian/control +++ b/debian/control @@ -1,24 +1,14 @@ Source: python-ovh Section: python Priority: optional -Maintainer: Arnaud Morin -Build-Depends: debhelper (>= 9), python-all, dh-python, python-setuptools, python3-setuptools, python3-all +Maintainer: Romain Beuque +Build-Depends: debhelper (>= 9), dh-python, python3-setuptools, python3-all Standards-Version: 3.9.5 -X-Python-Version: >= 2.7 X-Python3-Version: >= 3.4 -Package: python-ovh -Architecture: all -Depends: ${misc:Depends}, ${python:Depends}, python -Description: Wrapper around OVH's APIs (Python 2) - Lightweight wrapper around OVH's APIs. Handles all the hard work - including credential creation and requests signing. - . - This package provides Python 2 module bindings only. - Package: python3-ovh Architecture: all -Depends: ${misc:Depends}, ${python3:Depends}, python3 +Depends: ${misc:Depends}, ${python3:Depends}, python3, python3-requests Description: Wrapper around OVH's APIs (Python 3) Lightweight wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing. diff --git a/debian/rules b/debian/rules index 3d0c267..3bf9e91 100755 --- a/debian/rules +++ b/debian/rules @@ -3,5 +3,8 @@ #export DH_VERBOSE = 1 export PYBUILD_NAME = ovh +# do not launch unit tests during build +export DEB_BUILD_OPTIONS=nocheck + %: - dh $@ --with python2,python3 --buildsystem=pybuild + dh $@ --with python3 --buildsystem=pybuild diff --git a/scripts/build-debian-package-docker.sh b/scripts/build-debian-package-docker.sh new file mode 100755 index 0000000..6158074 --- /dev/null +++ b/scripts/build-debian-package-docker.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -euo pipefail + +exec docker run -it --rm --name python-ovh-debian-builder -v python-ovh-debian-builder-output:/output -v "${PWD}:/python-ovh:ro" debian:buster /python-ovh/scripts/build-debian-package-recipe.sh diff --git a/scripts/build-debian-package-recipe.sh b/scripts/build-debian-package-recipe.sh new file mode 100755 index 0000000..9190bc9 --- /dev/null +++ b/scripts/build-debian-package-recipe.sh @@ -0,0 +1,49 @@ +#!/bin/bash +set -e + +mkdir -p /home/pkg/ +cp -r /python-ovh/ /home/pkg/src +cd /home/pkg/src + +export DEBIAN_FRONTEND="noninteractive" +apt-get update +# Add basic packages +apt-get install -y ca-certificates apt-transport-https + +# Build package tooling +apt-get -yq install procps build-essential devscripts quilt debhelper +apt-get -yq install dh-systemd + + +DEBUILD_OPTIONS=--buildinfo-option=-O + +mkdir -p /home/pkg/src/ovh +if [ ! -f /home/pkg/src/ovh/bbb ] && [ ! -f /home/pkg/src/ovh/build ]; then + echo "INFO: BuildBot is creating an executable file in ovh/bbb" + mkdir -p /home/pkg/src/ovh + cat > /home/pkg/src/ovh/bbb << EOF +set -e +debuild $DEBUILD_OPTIONS -us -uc -b -j$(nproc) +EOF + + cat /home/pkg/src/ovh/bbb + chmod +x /home/pkg/src/ovh/bbb +fi + +echo "BUILDBOT> Prepare the build process with Debian build dependencies (if debian/control file exists)" +if [ -f /home/pkg/src/debian/control ]; then + mk-build-deps -r -t "apt-get --no-install-recommends -y" -i /home/pkg/src/debian/control +else + echo "INFO: /home/pkg/src/debian/control is absent...skipping mk-build-deps" +fi +if [ -f /home/pkg/src/ovh/bbb ]; then + echo "BUILDBOT> Starting the build process via /home/pkg/src/ovh/bbb" + cd /home/pkg/src && ./ovh/bbb +elif [ -f /home/pkg/src/ovh/build ]; then + echo "BUILDBOT> Starting the build process via /home/pkg/src/ovh/build" + cd /home/pkg/src && ./ovh/build +fi + +echo "BUILDBOT> Moving output to the artifact directory" +cd /home/pkg && find . -maxdepth 1 -type f -print -exec mv '{}' /output/ \; +chown -R 1000:1000 /output/ diff --git a/setup.cfg b/setup.cfg index f4c13f2..73629fb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,8 @@ [metadata] name = ovh -description = "Official OVH.com API wrapper" +description = "Official module to perform HTTP requests to the OVHcloud APIs" long_description = file: README.rst -version = 0.6.0 +version = 1.0.0 author = OVHcloud team - Romain Beuque author_email = api@ml.ovh.net url = https://api.ovh.com @@ -15,12 +15,12 @@ classifiers = Intended Audience :: Developers Operating System :: OS Independent Programming Language :: Python - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.4 - Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Topic :: Software Development :: Libraries :: Python Modules Topic :: System :: Archiving :: Packaging