Skip to content
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

Use poetry as the build tool and apply linting & styling #4

Merged
merged 6 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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: 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 = 88
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
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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
- 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
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