Skip to content

Commit 78bd9cb

Browse files
authored
Release 22.8 (#39)
* Release 22.8 * Fix issues#36
1 parent 11848de commit 78bd9cb

File tree

13 files changed

+67
-48
lines changed

13 files changed

+67
-48
lines changed

.github/workflows/python-package.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,10 @@ jobs:
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install pytest flake8
30-
pip install -r requirements.txt -r test-requirements.txt
31-
- name: Lint with flake8
32-
run: |
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37-
- name: Test with pytest
27+
run: make init
28+
- name: Lint
29+
run: make lint
30+
- name: Test
3831
env:
3932
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
40-
run: |
41-
pytest
33+
run: make test

Makefile

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
SRC=./aspose_barcode_cloud
22

33
.PHONY: all
4-
all: format test
4+
all: format lint test-all
5+
6+
.PHONY: check_git
7+
check_git:
8+
git fetch origin
9+
git diff origin/main --exit-code
10+
11+
.PHONY: clean
12+
clean:
13+
git clean -dfx --exclude='tests/configuration*.json'
14+
15+
.PHONY: dist
16+
dist:
17+
python3 setup.py sdist bdist_wheel --universal
518

619
.PHONY: format
720
format: format_code format_doc
@@ -17,35 +30,38 @@ format_doc:
1730
# Replace true->True false->False: sed -e "s/\b\(false\|true\)/\u\1/g"
1831
find . -type f -iname '*.md' -exec sed -i -e 's_\b\(false\|true\)_\u\1_g' '{}' \;
1932

20-
.PHONY: test
21-
test:
22-
tox $(SRC)
23-
24-
.PHONY: clean
25-
clean:
26-
git clean -dfx --exclude='tests/configuration*.json'
33+
.PHONY: init
34+
init:
35+
python -m pip install --upgrade pip
36+
python -m pip install -r requirements.txt -r test-requirements.txt
2737

28-
.PHONY: dist
29-
dist:
30-
python3 setup.py sdist bdist_wheel --universal
38+
.PHONY: init-docker
39+
init-docker:
40+
python3 -m pip install -r publish-requirements.txt
3141

32-
.PHONY: check_git
33-
check_git:
34-
git fetch origin
35-
git diff origin/main --exit-code
42+
.PHONY: lint
43+
lint:
44+
# stop the build if there are Python syntax errors or undefined names
45+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude '.*'
46+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
47+
flake8 . --count --exit-zero --max-line-length=127 --statistics --extend-ignore=E501 --extend-exclude '.*'
3648

3749
.PHONY: publish
38-
publish: check_git test clean dist
50+
publish: check_git test-all clean dist
3951
python3 -m twine upload dist/*
4052

41-
.PHONY: init-docker
42-
init-docker:
43-
python3 -m pip install -r publish-requirements.txt
44-
4553
.PHONY: publish-docker
46-
publish-docker: init-docker test dist
54+
publish-docker: init-docker test-all dist
4755
python3 -m twine upload dist/* --verbose
4856

57+
.PHONY: test
58+
test:
59+
python -Werror -m pytest --cov tests/
60+
61+
.PHONY: test-all
62+
test-all: lint
63+
tox $(SRC)
64+
4965
.PHONY: update
5066
update:
5167
echo "Not implemented"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![PyPI](https://img.shields.io/pypi/v/aspose-barcode-cloud)](https://pypi.org/project/aspose-barcode-cloud/)
66

77
- API version: 3.0
8-
- Package version: 22.7.0
8+
- Package version: 22.8.0
99

1010
## Demo applications
1111

@@ -22,7 +22,7 @@ This repository contains Aspose.BarCode Cloud SDK for Python source code. This S
2222
Supported Python versions:
2323

2424
- Python 2.7
25-
- Python 3.4+
25+
- Python 3.5+
2626

2727
To use these SDKs, you will need Client Id and Client Secret which can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/applications) (free registration in Aspose Cloud is required for this).
2828

aspose_barcode_cloud/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
8484
self.rest_client = rest.RESTClientObject(configuration)
8585
self.default_headers = {
8686
"x-aspose-client": "python sdk",
87-
"x-aspose-client-version": "22.7.0",
87+
"x-aspose-client-version": "22.8.0",
8888
}
8989
if header_name is not None:
9090
self.default_headers[header_name] = header_value
9191
self.cookie = cookie
9292
# Set default User-Agent.
93-
self.user_agent = "Aspose-Barcode-SDK/22.7.0/python"
93+
self.user_agent = "Aspose-Barcode-SDK/22.8.0/python"
9494

9595
def __del__(self):
9696
if self._pool is not None:

aspose_barcode_cloud/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def to_debug_report(self):
285285
"OS: {env}\n"
286286
"Python Version: {pyversion}\n"
287287
"Version of the API: 3.0\n"
288-
"SDK Package Version: 22.7.0".format(env=sys.platform, pyversion=sys.version)
288+
"SDK Package Version: 22.8.0".format(env=sys.platform, pyversion=sys.version)
289289
)
290290

291291
@staticmethod

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[tool.pytest.ini_options]
2+
filterwarnings = [
3+
"error",
4+
]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from setuptools import setup, find_packages
3030

3131
NAME = "aspose-barcode-cloud"
32-
VERSION = "22.7.0"
32+
VERSION = "22.8.0"
3333
# To install the library, run the following
3434
#
3535
# python setup.py install

test-requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
coverage>=4.0.3
1+
pytest
2+
pytest-cov
3+
flake8
24
mock; python_version < "3"
35
black; python_version > "3.7"

tests/load_configuration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import json
55
import logging
66
import os
7+
import six
78

89
from aspose_barcode_cloud import Configuration
910

@@ -27,7 +28,9 @@ def from_env(prefix):
2728
"""
2829
@rtype: Configuration
2930
"""
30-
constructor_param_names = inspect.getargspec(Configuration.__init__).args[1:]
31+
constructor_param_names = (
32+
inspect.getargspec(Configuration.__init__) if six.PY2 else inspect.getfullargspec(Configuration.__init__)
33+
).args[1:]
3134
kwargs = {}
3235
for name in constructor_param_names:
3336
env_name = "%s_%s" % (prefix, name.upper())

tests/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ def test_unauthorized_raises(self):
4040
with self.assertRaises(Exception) as context:
4141
api.get_barcode_generate(EncodeBarcodeType.QR, "Testing")
4242

43-
self.assertEqual(400, context.exception.status)
43+
self.assertEqual(401, context.exception.status)

0 commit comments

Comments
 (0)