...
 
Commits (4)
image: python:3.6-alpine
stages:
- test
- deploy
before_script:
- pip install twine
test:
stage: test
script:
- python3 setup.py sdist
- pip install dist/*
- apk add git
- python3 setup.py test
deploy_staging:
stage: deploy
variables:
TWINE_USERNAME: $STAGING_USERNAME
TWINE_PASSWORD: $STAGING_PASSWORD
script:
- VERSION_APPEND=${CI_JOB_ID} python setup.py sdist
- twine upload --repository-url $REPOSITORY_URL dist/*
except:
- tags
deploy_production:
stage: deploy
variables:
TWINE_USERNAME: $PRODUCTION_USERNAME
TWINE_PASSWORD: $PRODUCTION_PASSWORD
script:
- python setup.py sdist
- twine upload dist/*
only:
- tags
\ No newline at end of file
......@@ -31,7 +31,7 @@ class Gitlab(base.Resource):
`None` when using OAuth.
:vartype password: str
"""
self.apiroot = host + "/api/v3"
self.apiroot = host + "/api/v4"
if password is None:
if oauth_token:
......
#!/usr/bin/python
"""libsaas gitlab
==========
=================
Extension to libsaas library
"""
......@@ -9,15 +9,20 @@ import os
from distutils.core import setup, Command
from setuptools import setup, find_packages
VERSION = (0, 3, 0, 'dev')
VERSION = (0, 4, 0)
__version__ = ".".join(map(str, VERSION[0:3])) + "".join(VERSION[3:])
__description__ = "Python wrapper for GitLab API v3"
__version__ = ".".join(map(str, VERSION[0:3]))
try:
__version__ += "." + os.environ["VERSION_APPEND"]
except:
pass
__description__ = "Python wrapper for GitLab API v4"
__author__ = "b-sh"
__contact__ = "[email protected]"
__homepage__ = "https://gitlab.com/bor-sh-infrastructure/libsaas_gitlab"
__download__ = "https://gitlab.com/bor-sh-infrastructure/libsaas_gitlab/repository/archive.tar.gz?ref=v0.3"
__docformat__ = "markdown"
__copyright__ = ""
__license__ = "MIT"
......@@ -38,7 +43,11 @@ class Test(Command):
if not main().wasSuccessful():
raise SystemExit(1)
setup(name="libsaas_gitlab",
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="libsaas_gitlab",
version=__version__,
description=__description__,
author=__author__,
......@@ -48,15 +57,16 @@ setup(name="libsaas_gitlab",
license=__license__,
packages=find_packages(),
install_requires=install_requires,
long_description=__doc__,
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Database",
"Topic :: Software Development :: Libraries :: Python Modules",
],
......
......@@ -20,7 +20,7 @@ class GitlabTestCase(unittest.TestCase):
self.assertEqual(method, self.executor.request.method)
if uri:
self.assertEqual(self.executor.request.uri,
'https://gitlab.com/api/v3' + uri)
'https://gitlab.com/api/v4' + uri)
if params:
self.assertEqual(self.executor.request.params, params)
if headers:
......@@ -655,4 +655,4 @@ class GitlabTestCase(unittest.TestCase):
self.assertRaises(self.service.hook(3).update(data))
with port.assertRaises(MethodNotSupported):
self.assertRaises(self.service.hook(3).create(data))
\ No newline at end of file