Skip to content

Commit c8ef528

Browse files
authored
Merge pull request #3 from QualiSystemsLab/class-refactor
reset version and change package name
2 parents 26d100f + 3499a4b commit c8ef528

File tree

5 files changed

+117
-5
lines changed

5 files changed

+117
-5
lines changed

.github/workflows/lint-test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Lint and Test
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
push:
7+
branches: [master]
8+
9+
jobs:
10+
lint-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.7
18+
- name: install ALL dependencies
19+
run: |
20+
pip install -U -r requirements-dev.txt
21+
pip install -U -r requirements.txt
22+
pip install .
23+
- name: run pre-commit linters and formatters
24+
uses: pre-commit/action@v2.0.3
25+
- name: run pytest tests
26+
run: python -m pytest --import-mode=append tests/ --cov
27+

.github/workflows/release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# setup tools guide used as base template - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2+
# wait on check action used to wait for tests to finish - https://github.com/marketplace/actions/wait-on-check
3+
name: Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build-n-publish:
12+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Wait for lint and tests to succeed
17+
uses: lewagon/wait-on-check-action@v0.2
18+
with:
19+
ref: ${{ github.ref }}
20+
check-name: 'lint-test'
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
wait-interval: 10
23+
24+
- name: Checkout Code
25+
uses: actions/checkout@master
26+
27+
- name: Validate tag version - compare version.txt to tag
28+
run: |
29+
version=$(cat ./version.txt)
30+
tag=${GITHUB_REF/refs\/tags\//}
31+
tag="${tag:1}" # remove the 'v' prefix from the tag that triggered this action
32+
echo $version
33+
echo $tag
34+
if [ "$tag" == "$version" ]
35+
then
36+
echo "Tag and version are equal"
37+
else
38+
echo "Error: Tag and version are not equal, cannot create a release"
39+
exit 1
40+
fi
41+
42+
- name: Set up Python 3.7
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: 3.7
46+
47+
- name: Install pypa/build
48+
run: >-
49+
python -m
50+
pip install
51+
build
52+
--user
53+
54+
- name: Build a binary wheel and a source tarball
55+
run: >-
56+
python -m
57+
build
58+
--sdist
59+
--wheel
60+
--outdir dist/
61+
.
62+
63+
- name: Publish distribution 📦 to Test PyPI
64+
if: startsWith(github.ref, 'refs/tags')
65+
uses: pypa/gh-action-pypi-publish@master
66+
with:
67+
password: ${{ secrets.TEST_PYPI_TOKEN }}
68+
repository_url: https://test.pypi.org/legacy/
69+
skip_existing: true # skip duplicate uploads to test pypi
70+
71+
- name: Publish distribution 📦 to Real PyPI
72+
if: startsWith(github.ref, 'refs/tags')
73+
uses: pypa/gh-action-pypi-publish@master
74+
with:
75+
password: ${{ secrets.PYPI_API_TOKEN }}
76+
77+
78+
- name: Create Github Release and Upload Artifacts
79+
uses: softprops/action-gh-release@v1
80+
with:
81+
files: dist/*
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
requests>=2,<3
2-
abstract-http-client
2+
abstract-http-client>=1,<2

setup.cfg

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
name = cloudshell_sandboxapi_wrapper
2+
name = cloudshell-sandbox-rest
33
version = file: version.txt
44
author = QualiLab
55
author_email = support@qualisystems.com
@@ -20,8 +20,10 @@ package_dir =
2020
= src
2121
packages = find:
2222
python_requires = >=3.7
23-
install_requires =
24-
requests>=2
23+
install_requires =[
24+
requests>=2, <3
25+
abstract-http-client>=1,<2
26+
]
2527

2628
[options.packages.find]
2729
where = src

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
0.1.0

0 commit comments

Comments
 (0)