Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: move CI to GH #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2021
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
9 changes: 9 additions & 0 deletions .ci-before-script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ex

if [ "$STEP" != "tests" ]; then
exit 0
fi

sudo apt-get update
sudo apt install memcached
10 changes: 7 additions & 3 deletions .travis-runs-tests.sh → .ci-runs-tests.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#!/bin/bash
set -e
set -x
set -ex
env
if [ "$STEP" = "tests" ]; then
sudo service memcached stop
py.test --version
export PYTHONPATH=.
python setup.py develop
py.test --cov=bmemcached
exit 0
fi

if [ "$STEP" = "lint" ]; then
flake8
exit 0
fi

echo "Unknown step: $STEP"
exit 1
33 changes: 33 additions & 0 deletions .github/workflows/tests-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests and Lint

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
step:
- tests
- lint

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_test.txt && python setup.py develop
STEP="${{ matrix.step}}" ./.ci-before-script.sh
- name: Run tests or lint
run: |
STEP="${{ matrix.step}}" ./.ci-runs-tests.sh
14 changes: 0 additions & 14 deletions .travis-before-script.sh

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.formatting.provider": "black"
}
43 changes: 25 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
import os
from setuptools import setup
import sys


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


version_dependant_requirements = [
"uhashring < 2" if sys.version_info < (3, 6) else "uhashring", # It uses f-strings
]

setup(
name='python-binary-memcached',
version='0.30.1',
author='Jayson Reis',
author_email='[email protected]',
description='A pure python module to access memcached via its binary protocol with SASL auth support',
long_description='{0}\n{1}'.format(read('README.rst'), read('CHANGELOG.rst')),
url='https://github.com/jaysonsantos/python-binary-memcached',
packages=['bmemcached', 'bmemcached.client'],
name="python-binary-memcached",
version="0.30.1",
author="Jayson Reis",
author_email="[email protected]",
description="A pure python module to access memcached via its binary protocol with SASL auth support",
long_description="{0}\n{1}".format(read("README.rst"), read("CHANGELOG.rst")),
url="https://github.com/jaysonsantos/python-binary-memcached",
packages=["bmemcached", "bmemcached.client"],
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
install_requires=[
'six',
'uhashring',
"six",
]
+ version_dependant_requirements,
)