Skip to content

Commit fb2e021

Browse files
authored
Merge pull request #242 from jaysonsantos/github-actions
chore: move CI to GH
2 parents f44cbbf + 1fcf030 commit fb2e021

File tree

6 files changed

+77
-35
lines changed

6 files changed

+77
-35
lines changed

.ci-before-script.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
if [ "$STEP" != "tests" ]; then
5+
exit 0
6+
fi
7+
8+
sudo apt-get update
9+
sudo apt install memcached
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
#!/bin/bash
2-
set -e
3-
set -x
2+
set -ex
3+
env
44
if [ "$STEP" = "tests" ]; then
5-
sudo service memcached stop
65
py.test --version
76
export PYTHONPATH=.
87
python setup.py develop
98
py.test --cov=bmemcached
9+
exit 0
1010
fi
1111

1212
if [ "$STEP" = "lint" ]; then
1313
flake8
14+
exit 0
1415
fi
16+
17+
echo "Unknown step: $STEP"
18+
exit 1

.github/workflows/tests-and-lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Tests and Lint
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
max-parallel: 4
14+
matrix:
15+
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
16+
step:
17+
- tests
18+
- lint
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install Dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements_test.txt && python setup.py develop
30+
STEP="${{ matrix.step}}" ./.ci-before-script.sh
31+
- name: Run tests or lint
32+
run: |
33+
STEP="${{ matrix.step}}" ./.ci-runs-tests.sh

.travis-before-script.sh

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

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.formatting.provider": "black"
3+
}

setup.py

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
11
import os
22
from setuptools import setup
3+
import sys
34

45

56
def read(filename):
67
return open(os.path.join(os.path.dirname(__file__), filename)).read()
78

89

10+
version_dependant_requirements = [
11+
"uhashring < 2" if sys.version_info < (3, 6) else "uhashring", # It uses f-strings
12+
]
13+
914
setup(
10-
name='python-binary-memcached',
11-
version='0.30.1',
12-
author='Jayson Reis',
13-
author_email='[email protected]',
14-
description='A pure python module to access memcached via its binary protocol with SASL auth support',
15-
long_description='{0}\n{1}'.format(read('README.rst'), read('CHANGELOG.rst')),
16-
url='https://github.com/jaysonsantos/python-binary-memcached',
17-
packages=['bmemcached', 'bmemcached.client'],
15+
name="python-binary-memcached",
16+
version="0.30.1",
17+
author="Jayson Reis",
18+
author_email="[email protected]",
19+
description="A pure python module to access memcached via its binary protocol with SASL auth support",
20+
long_description="{0}\n{1}".format(read("README.rst"), read("CHANGELOG.rst")),
21+
url="https://github.com/jaysonsantos/python-binary-memcached",
22+
packages=["bmemcached", "bmemcached.client"],
1823
classifiers=[
19-
'Development Status :: 4 - Beta',
20-
'License :: OSI Approved :: MIT License',
21-
'Operating System :: OS Independent',
22-
'Programming Language :: Python :: 2.7',
23-
'Programming Language :: Python :: 3.4',
24-
'Programming Language :: Python :: 3.5',
25-
'Programming Language :: Python :: 3.6',
26-
'Programming Language :: Python :: 3.7',
24+
"Development Status :: 4 - Beta",
25+
"License :: OSI Approved :: MIT License",
26+
"Operating System :: OS Independent",
27+
"Programming Language :: Python :: 2.7",
28+
"Programming Language :: Python :: 3.4",
29+
"Programming Language :: Python :: 3.5",
30+
"Programming Language :: Python :: 3.6",
31+
"Programming Language :: Python :: 3.7",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
2734
],
2835
install_requires=[
29-
'six',
30-
'uhashring',
36+
"six",
3137
]
38+
+ version_dependant_requirements,
3239
)

0 commit comments

Comments
 (0)