diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0af649b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: [push, pull_request] + +jobs: + test: + name: Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.6", "3.7", "3.8"] + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Setup Conda Environment + uses: conda-incubator/setup-miniconda@16930e6 + with: + auto-update-conda: true + miniconda-version: latest + activate-environment: test + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + shell: bash -l {0} + run: conda install -c conda-forge pytest flake8 black heapdict python-lmdb psutil + + - name: Install zict + shell: bash -l {0} + run: python setup.py install + + - name: Run flake8 + shell: bash -l {0} + run: flake8 zict + + - name: Run black + shell: bash -l {0} + run: black --check zict + + - name: Run pytest + shell: bash -l {0} + run: pytest --doctest-modules zict diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index af974ed..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -sudo: False - -language: python - -matrix: - include: - - python: 3.6 - - python: 3.7 - - python: 3.8 - -install: - # Install conda - - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - conda config --set always_yes yes --set changeps1 no - - conda update conda - - # Install dependencies - - conda create -n test -c conda-forge python=$TRAVIS_PYTHON_VERSION pytest flake8 black heapdict - - source activate test - - conda install -c conda-forge python-lmdb psutil - - - python setup.py install - -script: - - py.test --doctest-modules zict - - flake8 zict - - black --check zict - -notifications: - email: false diff --git a/README.rst b/README.rst index 2ed1ac0..6391175 100644 --- a/README.rst +++ b/README.rst @@ -6,5 +6,5 @@ Zict Mutable Mapping interfaces. See documentation_. .. _documentation: http://zict.readthedocs.io/en/latest/ -.. |Build Status| image:: https://travis-ci.org/dask/zict.svg?branch=master - :target: https://travis-ci.org/dask/zict +.. |Build Status| image:: https://github.com/dask/zict/workflows/CI/badge.svg + :target: https://github.com/dask/zict/actions?query=workflow%3ACI diff --git a/zict/buffer.py b/zict/buffer.py index 0d974f7..ec256a6 100644 --- a/zict/buffer.py +++ b/zict/buffer.py @@ -5,7 +5,7 @@ class Buffer(ZictBase): - """ Buffer one dictionary on top of another + """Buffer one dictionary on top of another This creates a MutableMapping by combining two MutableMappings, one that feeds into the other when it overflows, based on an LRU mechanism. When diff --git a/zict/file.py b/zict/file.py index a682357..f43521a 100644 --- a/zict/file.py +++ b/zict/file.py @@ -20,7 +20,7 @@ def _unsafe_key(key): class File(ZictBase): - """ Mutable Mapping interface to a directory + """Mutable Mapping interface to a directory Keys must be strings, values must be bytes diff --git a/zict/func.py b/zict/func.py index a023777..4445312 100644 --- a/zict/func.py +++ b/zict/func.py @@ -2,7 +2,7 @@ class Func(ZictBase): - """ Buffer a MutableMapping with a pair of input/output functions + """Buffer a MutableMapping with a pair of input/output functions Parameters ---------- diff --git a/zict/lmdb.py b/zict/lmdb.py index 806558e..87603a7 100644 --- a/zict/lmdb.py +++ b/zict/lmdb.py @@ -12,7 +12,7 @@ def _decode_key(key): class LMDB(ZictBase): - """ Mutable Mapping interface to a LMDB database. + """Mutable Mapping interface to a LMDB database. Keys must be strings, values must be bytes @@ -38,7 +38,11 @@ def __init__(self, directory): # `map_size` may be reserved up front on disk writemap = sys.platform.startswith("linux") self.db = lmdb.open( - directory, subdir=True, map_size=map_size, sync=False, writemap=writemap, + directory, + subdir=True, + map_size=map_size, + sync=False, + writemap=writemap, ) def __getitem__(self, key): diff --git a/zict/lru.py b/zict/lru.py index b5fc4ae..32dd106 100644 --- a/zict/lru.py +++ b/zict/lru.py @@ -8,7 +8,7 @@ def do_nothing(k, v): class LRU(ZictBase): - """ Evict Least Recently Used Elements + """Evict Least Recently Used Elements Parameters ---------- @@ -70,7 +70,7 @@ def __setitem__(self, key, value): self.evict() def evict(self): - """ Evict least recently used key + """Evict least recently used key This is typically called from internal use, but can be externally triggered as well. diff --git a/zict/sieve.py b/zict/sieve.py index 44f8ffb..1728f94 100644 --- a/zict/sieve.py +++ b/zict/sieve.py @@ -5,7 +5,7 @@ class Sieve(ZictBase): - """ Store values in different mappings based on a selector's + """Store values in different mappings based on a selector's output. This creates a MutableMapping combining several underlying diff --git a/zict/zip.py b/zict/zip.py index d8f054c..23b62b7 100644 --- a/zict/zip.py +++ b/zict/zip.py @@ -6,7 +6,7 @@ class Zip(MutableMapping): - """ Mutable Mapping interface to a Zip file + """Mutable Mapping interface to a Zip file Keys must be strings, values must be bytes