Skip to content

Commit

Permalink
Use poetry as the build tool and apply linting & styling (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ince authored Nov 24, 2023
1 parent d341d99 commit 7e79be6
Show file tree
Hide file tree
Showing 25 changed files with 1,458 additions and 278 deletions.
9 changes: 0 additions & 9 deletions .dockerignore

This file was deleted.

12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
max-line-length = 120
max-complexity = 10
select = C,E,F,W,B,B950
ignore = E211, E999, F401, F821, W503
exclude =
.git,
.direnv,
.tox,
dist
*.egg-info,
.pytest_cache
35 changes: 35 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build and test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
POETRY_HOME: "/opt/poetry"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up python
uses: actions/setup-python@v4
with:
python-version: |
3.9
3.10
3.11
3.12
- name: install poetry
run: |
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip install poetry==1.7.1
$POETRY_HOME/bin/poetry --version
- name: add poetry to path
run: echo "${POETRY_HOME}/bin" >> $GITHUB_PATH
- name: install dependencies and build
run: poetry install
- name: run tests
run: poetry run tox -p
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,7 @@ dmypy.json
.pyre/

# ide
.idea/
.idea/

.direnv
.envrc
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.0
hooks:
- id: mypy
exclude: ^tests/
args: [ --strict ]
23 changes: 0 additions & 23 deletions Dockerfile

This file was deleted.

41 changes: 0 additions & 41 deletions Makefile

This file was deleted.

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,23 @@ If you don't want requirements on pulling this module from github via
https, simply vendor a copy of the module into your project. You only
need the `neo4j_arrow` directory.

# Build

This project uses [poetry]() as the build tool.
Install `poetry`, define your environment with `poetry env use` and invoke `poetry install` to install dependencies.

To build;

```
poetry build
```

To run tests;

```
poetry run tox
```

# Usage

The client is designed to be lightweight and lazy. As such, you should
Expand Down
2 changes: 1 addition & 1 deletion example_models/bigquery_model.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
"target_field": "paper"
}
]
}
}
2 changes: 1 addition & 1 deletion example_models/gcs_model.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
"target_field": "paper"
}
]
}
}
2 changes: 1 addition & 1 deletion example_models/stackoverflow_model.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
}
}
]
}
}
Loading

0 comments on commit 7e79be6

Please sign in to comment.