Skip to content

Commit

Permalink
Merge pull request #11 from project-delphi/dependencies
Browse files Browse the repository at this point in the history
build(dependencies): refactor package dependencies out of requirement…
  • Loading branch information
project-delphi authored Feb 13, 2024
2 parents 3f3b480 + 3153c7b commit ae20db1
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 42 deletions.
17 changes: 6 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ repos:
- id: debug-statements
- id: name-tests-test
- id: requirements-txt-fixer
filenames: "./requirements/requirements_dev.txt ./requirements/requirements_test.txt ./requirements/requirements_run.txt"
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
Expand All @@ -30,20 +29,20 @@ repos:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.12.0
rev: v3.14.1
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.8.0
hooks:
- id: mypy
args: ["--config-file", "pyproject.toml"]
Expand All @@ -53,16 +52,12 @@ repos:
- types-chardet
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.1
rev: v0.2.1
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: ["--fix"]
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.7.1
hooks:
- id: nbstripout
- repo: https://github.com/hadolint/hadolint
rev: v2.12.1-beta
hooks:
- id: hadolint
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,27 @@ install-upgrade-pip:# Upgrade pip version
.PHONY: install-dev
install-dev:# Install developer dependencies (formatting, linting)
source ./.venv/bin/activate
pip install -r requirements_dev.txt
pip install -e ".[dev]"



.PHONY: install-run
install-run:# Install application only dependencies
source ./.venv/bin/activate
pip install -r requirements.txt
pip install -e .

.PHONY: install
install: install-upgrade-pip install-dev install-run# Upgrade pip and install developer, test & application dependencies

.PHONY: uninstall-dev
uninstall-dev:# Uninstall developer dependencies
source ./.venv/bin/activate
pip uninstall -r requirements_dev.txt
pip uninstall ".[dev]"

.PHONY: uninstall-run
uninstall-run:# Uninstall application only dependencies
source ./.venv/bin/activate
pip uninstall -r requirements.txt
pip uninstall .

.PHONY: uninstall
uninstall:# Uninstall all dependencies
Expand Down
1 change: 0 additions & 1 deletion experimental/.gitkeep
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

6 changes: 3 additions & 3 deletions notebooks/notebooks_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "a35eeb9f-df70-4ab1-a243-2d2025888eb0",
"id": "0",
"metadata": {},
"source": [
"# Introduction to the JupyterLab and Jupyter Notebooks\n",
Expand Down Expand Up @@ -39,7 +39,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "fe55883a-6887-43dd-9498-5333a51799e2",
"id": "1",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -58,7 +58,7 @@
},
{
"cell_type": "markdown",
"id": "b9670d85-ef29-4dfd-b4b5-e76d279c1f1a",
"id": "2",
"metadata": {},
"source": [
"## Next steps 🏃\n",
Expand Down
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
[build-system]
requires = [
"flit_core >=3.2,<4",
]
build-backend = "flit_core.buildapi"

[project]
name = "project-scaffold"
version = "0.1.0"
description = "Scaffold to start DS/ML projects"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
]
dependencies = [
"click",
"fastapi",
"flax",
"jax",
"keras",
"matplotlib",
"numpy",
"pandas",
"pytorch-tabnet",
"scikit-learn",
"tensorflow",
"torch",
"torchaudio",
"torchvision",
"uvicorn[standard]",
]

[project.optional-dependencies]
dev = [
"black[jupyter]",
"commitizen",
"coverage",
"ipython",
"isort",
"jupytext",
"mypy",
"nbstripout",
"pre-commit",
"pydoclint",
"pytest",
"pytest-cov",
"pyupgrade",
"ruff",
"tqdm",
]

[tool.ruff]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["D", "E", "F", "I"]
Expand Down Expand Up @@ -62,6 +120,9 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.10.
target-version = "py310"

[tool.flit.module]
name="src"

[tool.ruff.per-file-ignores]
"*test*.py" = ["D"] # ignore all docstring lints in tests

Expand Down
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

15 changes: 0 additions & 15 deletions requirements_dev.txt

This file was deleted.

8 changes: 8 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
The __init__ module.
It serves as the entry point for the package and contains the initialization logic.
Author: Ravi Kalia
Date: 02/13/2024
"""
1 change: 1 addition & 0 deletions src/tests/module_2_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Placeholder for module 2 tests docstring."""

from utils.module_2 import bye


Expand Down

0 comments on commit ae20db1

Please sign in to comment.