Skip to content

Commit 1e7a012

Browse files
authored
Merge pull request #113 from RedisLabsModules/ck-poetry
2 parents 6456a1b + bfafc3f commit 1e7a012

File tree

7 files changed

+93
-81
lines changed

7 files changed

+93
-81
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
timeout-minutes: 10
1414
strategy:
1515
matrix:
16-
platform: [ubuntu-18.04, ubuntu-16.04]
17-
python: ['2.7', '3.6', '3.8' ]
16+
platform: ['ubuntu-20.04', 'ubuntu-18.04', 'ubuntu-16.04']
17+
python: ['3.6', '3.7', '3.8' '3.9']
1818

1919
steps:
2020
- uses: actions/checkout@v2
@@ -44,9 +44,9 @@ jobs:
4444
4545
- name: Install Python dependencies
4646
run: |
47-
sudo apt-get install -y python-setuptools
48-
sudo apt-get install -y python3-setuptools
49-
pip install -r requirements.txt
47+
sudo apt-get install -y python-setuptools python3-setuptools
48+
pip install poetry
49+
poetry install
5050
5151
- name: Cache Redis
5252
id: cache-redis
@@ -72,7 +72,6 @@ jobs:
7272
- name: Unit Test with pytest
7373
timeout-minutes: 5
7474
run: |
75-
pip install pytest
7675
TLS_CERT=./redis/tests/tls/redis.crt \
7776
TLS_KEY=./redis/tests/tls/redis.key \
7877
TLS_CACERT=./redis/tests/tls/ca.crt \
@@ -185,8 +184,6 @@ jobs:
185184
- name: Generate coverage report
186185
if: matrix.platform == 'ubuntu-18.04' && matrix.python == '3.6'
187186
run: |
188-
pip install pytest
189-
pip install pytest-cov
190187
TLS_CERT=./redis/tests/tls/redis.crt \
191188
TLS_KEY=./redis/tests/tls/redis.key \
192189
TLS_CACERT=./redis/tests/tls/ca.crt \

.github/workflows/publish-pypi.yml

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,43 @@
11
name: Publish Pypi
22
on:
33
release:
4-
types: [published]
4+
types: [ published ]
55

66
jobs:
7-
publish:
8-
name: publish
7+
pytest:
8+
name: Publish to PyPi
99
runs-on: ubuntu-latest
10+
env:
11+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
1012
steps:
1113
- uses: actions/checkout@master
12-
- name: Set up Python 2.7
14+
- name: Set up Python 3.7
1315
uses: actions/setup-python@v1
1416
with:
15-
python-version: 2.7
17+
python-version: 3.7
1618

17-
- name: Install twine
18-
run: |
19-
pip install twine
20-
21-
- name: Install wheel
22-
run: |
23-
pip install wheel
24-
25-
- name: Create a source distribution
26-
run: |
27-
python setup.py sdist
19+
- name: Install Poetry
20+
uses: dschep/[email protected]
2821

29-
- name: Create a wheel
30-
run: |
31-
python setup.py bdist_wheel
22+
- name: Cache Poetry virtualenv
23+
uses: actions/cache@v1
24+
id: cache
25+
with:
26+
path: ~/.virtualenvs
27+
key: poetry-${{ hashFiles('**/poetry.lock') }}
28+
restore-keys: |
29+
poetry-${{ hashFiles('**/poetry.lock') }}
3230
33-
- name: Create a .pypirc
31+
- name: Set Poetry config
3432
run: |
35-
echo -e "[pypi]" >> ~/.pypirc
36-
echo -e "username = __token__" >> ~/.pypirc
37-
echo -e "password = ${{ secrets.PYPI_TOKEN }}" >> ~/.pypirc
38-
echo -e "[testpypi]" >> ~/.pypirc
39-
echo -e "username = __token__" >> ~/.pypirc
40-
echo -e "password = ${{ secrets.TESTPYPI_TOKEN }}" >> ~/.pypirc
33+
poetry config virtualenvs.in-project false
34+
poetry config virtualenvs.path ~/.virtualenvs
4135
42-
- name: Publish to Test PyPI
43-
if: github.event_name == 'release'
44-
run: |
45-
twine upload --skip-existing -r testpypi dist/*
36+
- name: Install Dependencies
37+
run: poetry install
38+
if: steps.cache.outputs.cache-hit != 'true'
4639

4740
- name: Publish to PyPI
4841
if: github.event_name == 'release'
4942
run: |
50-
twine upload -r pypi dist/*
43+
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }} --build

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,7 @@ venv.bak/
108108
.mypy_cache/
109109

110110
# Covers JetBrains PyCharm
111-
.idea
111+
.idea
112+
113+
# vscode
114+
.vscode

RLTest/_version.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

22
# This attribute is the only one place that the version number is written down,
33
# so there is only one place to change it when the version number changes.
4-
__version__ = "0.3.1"
4+
import pkg_resources
5+
try:
6+
__version__ = pkg_resources.get_distribution('RLTest').version
7+
except (pkg_resources.DistributionNotFound, AttributeError):
8+
__version__ = "99.99.99" # like redis modules

pyproject.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[tool.poetry]
2+
name = "RLTest"
3+
version = "0.4"
4+
description="Redis Labs Test Framework, allow to run tests on redis and modules on a variety of environments"
5+
authors = ["RedisLabs <[email protected]>"]
6+
license = "BSD-3-Clause"
7+
readme = "README.md"
8+
9+
packages = [
10+
{ include = 'RLTest' },
11+
]
12+
13+
classifiers = [
14+
'Topic :: Database',
15+
'Programming Language :: Python',
16+
'Intended Audience :: Developers',
17+
'Programming Language :: Python :: 3.6',
18+
'Programming Language :: Python :: 3.7',
19+
'Programming Language :: Python :: 3.8',
20+
'Programming Language :: Python :: 3.9',
21+
'License :: OSI Approved :: BSD License',
22+
'Development Status :: 5 - Production/Stable'
23+
]
24+
25+
[tool.poetry.dependencies]
26+
python = "^3.6"
27+
redis = ">=3.0.0"
28+
redis-py-cluster = ">=2.1.0"
29+
distro = ">=1.4.0"
30+
psutil = "^3.0.0"
31+
32+
[tool.poetry.dev-dependencies]
33+
codecov = "^2.1.11"
34+
flake8 = "^3.9.2"
35+
rmtest = "^0.7.0"
36+
nose = "^1.3.7"
37+
ml2rt = "^0.2.0"
38+
tox = ">=3.23.1"
39+
tox-poetry = "^0.3.0"
40+
bandit = "^1.7.0"
41+
pylint = "^2.8.2"
42+
vulture = "^2.3"
43+
pytest = "^6.2.4"
44+
pytest-cov = "^2.12.0"
45+
46+
[tool.poetry.urls]
47+
repository = "https://github.com/RedisLabsModules/RLTest"
48+
49+
[tool.poetry.scripts]
50+
RLTest = 'RLTest.__main__:main'
51+
52+
53+
[build-system]
54+
requires = ["poetry-core>=1.0.0"]
55+
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)