Skip to content

Commit 5d0255e

Browse files
Improve testing framework (#23)
* Add unit tests * Add setup.py * Update automation and build scripts * Update gitignore file * Fix testing imports, rebase updates
1 parent 855fd40 commit 5d0255e

File tree

7 files changed

+537
-128
lines changed

7 files changed

+537
-128
lines changed

.circleci/config.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Check https://circleci.com/docs/2.0/language-python/ for more details
44
#
5-
version: 2
5+
version: 2.1
66
jobs:
77
build:
88
docker:
@@ -35,11 +35,15 @@ jobs:
3535
key: v1-dependencies-{{ checksum "requirements.txt" }}
3636

3737
- run:
38-
name: examples
38+
name: build dist
39+
command: python setup.py sdist
40+
41+
- run:
42+
name: run tests
3943
command: |
4044
. venv/bin/activate
41-
redisgraph-bulk-loader -n ./example/Person.csv -n ./example/Country.csv -r ./example/KNOWS.csv -r ./example/VISITED.csv Visits
42-
redisgraph-bulk-loader -n ./example2/Robots.csv Robots
45+
pip install git+https://github.com/RedisGraph/redisgraph-py.git@master
46+
python -m unittest test/test_bulk_loader.py
4347
4448
workflows:
4549
version: 2
@@ -55,4 +59,4 @@ workflows:
5559
only:
5660
- master
5761
jobs:
58-
- build
62+
- build

.gitignore

Lines changed: 5 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -85,123 +85,12 @@ __pycache__/
8585
# C extensions
8686
*.so
8787

88-
# Distribution / packaging
89-
.Python
90-
build/
91-
develop-eggs/
92-
dist/
93-
downloads/
94-
eggs/
95-
.eggs/
96-
lib/
97-
lib64/
98-
parts/
99-
sdist/
100-
var/
101-
wheels/
102-
pip-wheel-metadata/
103-
share/python-wheels/
104-
*.egg-info/
105-
.installed.cfg
106-
*.egg
107-
MANIFEST
108-
109-
# PyInstaller
110-
# Usually these files are written by a python script from a template
111-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
112-
*.manifest
113-
*.spec
114-
115-
# Installer logs
116-
pip-log.txt
117-
pip-delete-this-directory.txt
118-
119-
# Unit test / coverage reports
120-
htmlcov/
121-
.tox/
122-
.nox/
123-
.coverage
124-
.coverage.*
125-
.cache
126-
nosetests.xml
127-
coverage.xml
128-
*.cover
129-
*.py,cover
130-
.hypothesis/
131-
.pytest_cache/
132-
133-
# Translations
134-
*.mo
135-
*.pot
136-
137-
# Django stuff:
138-
*.log
139-
local_settings.py
140-
db.sqlite3
141-
db.sqlite3-journal
142-
143-
# Flask stuff:
144-
instance/
145-
.webassets-cache
146-
147-
# Scrapy stuff:
148-
.scrapy
149-
150-
# Sphinx documentation
151-
docs/_build/
152-
153-
# PyBuilder
154-
target/
155-
156-
# Jupyter Notebook
157-
.ipynb_checkpoints
158-
159-
# IPython
160-
profile_default/
161-
ipython_config.py
162-
163-
# pyenv
164-
.python-version
165-
166-
# pipenv
167-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
168-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
169-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
170-
# install all needed dependencies.
171-
#Pipfile.lock
172-
173-
# celery beat schedule file
174-
celerybeat-schedule
175-
176-
# SageMath parsed files
177-
*.sage.py
178-
179-
# Environments
180-
.env
88+
# virtualenv
18189
.venv
182-
env/
18390
venv/
18491
ENV/
185-
env.bak/
186-
venv.bak/
187-
188-
# Spyder project settings
189-
.spyderproject
190-
.spyproject
191-
192-
# Rope project settings
193-
.ropeproject
194-
195-
# mkdocs documentation
196-
/site
19792

198-
# mypy
199-
.mypy_cache/
200-
.dmypy.json
201-
dmypy.json
202-
203-
# Pyre type checker
204-
.pyre/
205-
206-
# Mac
207-
*.DS_Store
93+
# Distribution / packaging
94+
.Python
95+
dist/
96+
*.egg-info/

redisgraph_bulk_loader/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__all__ = [
44
'bulk_insert',
5-
]
5+
]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
redis==2.10.6
2-
click>=6.7
1+
click>=7.0
2+
redis>=2.10.6

setup.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
11
from setuptools import setup, find_packages
2+
import io
3+
4+
5+
def read_all(f):
6+
with io.open(f, encoding="utf-8") as io_file:
7+
return io_file.read()
8+
9+
10+
requirements = list(map(str.strip, open("requirements.txt").readlines()))
11+
12+
213
setup(
314
name='redisgraph-bulk-loader',
415
python_requires='>=3',
516
version='0.8.1',
17+
description='RedisGraph Bulk Import Tool',
18+
long_description=read_all("README.md"),
19+
url='https://github.com/redisgraph/redisgraph-bulk-loader',
620
packages=find_packages(),
7-
install_requires=[
8-
'redis',
9-
'click'
21+
install_requires=requirements,
22+
classifiers=[
23+
'Development Status :: 4 - Beta',
24+
'Intended Audience :: Developers',
25+
'License :: OSI Approved :: BSD License',
26+
'Programming Language :: Python :: 3.0',
27+
'Topic :: Database'
1028
],
29+
keywords='Redis Graph Extension',
30+
author='RedisLabs',
31+
author_email='[email protected]',
32+
1133
entry_points='''
1234
[console_scripts]
1335
redisgraph-bulk-loader=redisgraph_bulk_loader.bulk_insert:bulk_insert
1436
'''
15-
)
37+
)

test/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)