Skip to content

Commit

Permalink
use poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldrian Harjati committed Sep 7, 2023
1 parent ade2867 commit d521dcd
Show file tree
Hide file tree
Showing 7 changed files with 742 additions and 23 deletions.
16 changes: 10 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
FROM continuumio/miniconda3:master-alpine
FROM python:3.11-alpine

LABEL maintainer="Ethan Bienstock"

COPY requirements.txt .
COPY ../pyproject.toml .
COPY ../poetry.lock .

ENV PATH /opt/conda/bin:$PATH

# install git and alpine sdk for c compiler extensions
RUN apk add --update git curl alpine-sdk

# install pip dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt && \
rm requirements.txt
RUN pip install --upgrade pip & \
pip install poetry

# run poetry install
RUN poetry config virtualenvs.create false
RUN poetry install --no-root

# create a non root sbl user
ARG USER=sbl
Expand All @@ -29,4 +33,4 @@ RUN adduser -D $USER \
ENV PATH="/home/sbl/.local/bin:${PATH}"

USER $USER
WORKDIR $HOME
WORKDIR $HOME
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
Expand Down
6 changes: 0 additions & 6 deletions .devcontainer/requirements.txt

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ __pycache__
.DS_Store
.ruff_cache/

#pytest
.coverage
coverage.xml

# excel artifact
~$example_sblar.xlsx
645 changes: 645 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[tool.poetry]
name = "regtech-data-validator"
version = "0.1.0"
description = ""
authors = []
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
black = "23.3.0"
ruff = "0.0.259"
pandas = "2.1.0"
pandera = "0.16.1"
pytest = "7.4.0"
pytest-cov = "4.1.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

# Black formatting
[tool.black]
preview = true
skip-string-normalization = true
line-length = 120
include = '\.pyi?$'
exclude = '''
/(
| .gitignore # list of files or directories to be excluded in the
| .git # root of the project
| Dockerfile
| .github
| .devcontainer
| data
)/
'''

# Linting
[tool.ruff]
# Same as Black.
line-length = 120

# Testing
[tool.pytest.ini_options]
addopts = [
"--cov-report=term-missing",
"--cov-branch",
"--cov-report=xml",
"--cov-report=term",
"--cov=src",
"-vv",
"--strict-markers",
"-rfE",
]
testpaths = [
"src/tests",
]

[tool.coverage.run]
relative_files = true
source = ["src"]

[tool.coverage.report]
skip_empty = true
# Regexes for lines to exclude from consideration
exclude_also = [
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",

# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
10 changes: 0 additions & 10 deletions setup.cfg

This file was deleted.

0 comments on commit d521dcd

Please sign in to comment.