Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ commit = True
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

[bumpversion:file:setup.cfg]
search = version = '{current_version}'
replace = version = '{new_version}'
[bumpversion:file:setup.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
12 changes: 8 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
npm install -g @semantic-release/github
npm install -g @semantic-release/commit-analyzer
npm install -g @semantic-release/release-notes-generator
npm install -g semantic-release-pypi
pip3 install setuptools wheel twine
- name: Publish js docs
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
Expand All @@ -59,7 +57,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: npx semantic-release #--dry-run --branches 9388_gha Uncomment for testxing purposes
- name: Build binary wheel and a source tarball
run: python setup.py sdist
run: |
pip3 install setuptools wheel twine build
python -m build --sdist --outdir dist/
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2 # Try to update version tag every release
with:
password: ${{ secrets.PYPI_TOKEN }}
repository_url: https://upload.pypi.org/legacy/ # This must be changed if testing deploys to test.pypi.org
6 changes: 0 additions & 6 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
"message": "chore(release): ${nextRelease.version} release notes\n\n${nextRelease.notes}"
}
],
[
"semantic-release-pypi",
{
"repoUrl": "https://upload.pypi.org/legacy"
}
],
"@semantic-release/github"
]
}
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

60 changes: 13 additions & 47 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,27 @@
# limitations under the License.

from setuptools import setup
from setuptools.command.test import test as TestCommand
import os
import sys
from os import path

__version__ = '5.2.0'

if sys.argv[-1] == 'publish':
# test server
os.system('python setup.py register -r pypitest')
os.system('python setup.py sdist upload -r pypitest')

# production server
os.system('python setup.py register -r pypi')
os.system('python setup.py sdist upload -r pypi')
sys.exit()

# Convert README.md to README.rst for pypi
try:
from pypandoc import convert_file

def read_md(f):
return convert_file(f, 'rst')

# read_md = lambda f: convert(f, 'rst')
except:
print('warning: pypandoc module not found, '
'could not convert Markdown to RST')

def read_md(f):
return open(f, 'rb').read().decode(encoding='utf-8')
# read_md = lambda f: open(f, 'rb').read().decode(encoding='utf-8')


class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['--strict', '--verbose', '--tb=long', 'test']
self.test_suite = True

def run_tests(self):
import pytest
errcode = pytest.main(self.test_args)
sys.exit(errcode)

# read contents of README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as file:
readme_file = file.read()

setup(name='ibm-watson',
version=__version__,
description='Client library to use the IBM Watson Services',
packages=['ibm_watson'],
install_requires=['requests>=2.0, <3.0', 'python_dateutil>=2.5.3', 'websocket-client==1.1.0', 'ibm_cloud_sdk_core>=3.3.6, == 3.*'],
tests_require=['responses', 'pytest', 'python_dotenv', 'pytest-rerunfailures'],
license='Apache 2.0',
install_requires=['requests>=2.0, <3.0', 'python_dateutil>=2.5.3', 'websocket-client==0.48.0', 'ibm_cloud_sdk_core>=3.3.6, == 3.*'],
tests_require=['responses', 'pytest', 'python_dotenv', 'pytest-rerunfailures', 'tox'],
cmdclass={'test': PyTest},
author='IBM Watson',
author_email='watdevex@us.ibm.com',
long_description=read_md('README.md'),
long_description=readme_file,
long_description_content_type='text/markdown',
url='https://github.com/watson-developer-cloud/python-sdk',
packages=['ibm_watson'],
include_package_data=True,
keywords='language, vision, question and answer' +
' tone_analyzer, natural language classifier,' +
Expand All @@ -81,7 +47,7 @@ def run_tests(self):
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
Expand Down