Skip to content

Commit d5f3549

Browse files
authored
Merge pull request #1 from MITLibraries/TIMX-414-scaffold-library-project
TIMX 414 - initial library scaffolding
2 parents 3c6e7b6 + 3339f13 commit d5f3549

15 files changed

Lines changed: 1460 additions & 6 deletions

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
# Maintain dependencies for GitHub Actions
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
14+
# Maintain dependencies for npm
15+
- package-ecosystem: "pip"
16+
directory: "/"
17+
schedule:
18+
interval: "daily"

.github/pull-request-template.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
### Purpose and background context
2+
Describe the overall purpose of the PR changes and any useful background context.
3+
4+
### How can a reviewer manually see the effects of these changes?
5+
Explain how to see the proposed changes in the application if possible.
6+
7+
Delete this section if it isn't applicable to the PR.
8+
9+
### Includes new or updated dependencies?
10+
YES | NO
11+
12+
### Changes expectations for external applications?
13+
YES | NO
14+
15+
### What are the relevant tickets?
16+
- Include links to Jira Software and/or Jira Service Management tickets here.
17+
18+
### Developer
19+
- [ ] All new ENV is documented in README
20+
- [ ] All new ENV has been added to staging and production environments
21+
- [ ] All related Jira tickets are linked in commit message(s)
22+
- [ ] Stakeholder approval has been confirmed (or is not needed)
23+
24+
### Code Reviewer(s)
25+
- [ ] The commit message is clear and follows our guidelines (not just this PR message)
26+
- [ ] There are appropriate tests covering any new functionality
27+
- [ ] The provided documentation is sufficient for understanding any new functionality introduced
28+
- [ ] Any manual tests have been performed **or** provided examples verified
29+
- [ ] New dependencies are appropriate or there were no changes
30+

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: CI
2+
on: push
3+
jobs:
4+
test:
5+
uses: mitlibraries/.github/.github/workflows/python-shared-test.yml@main
6+
lint:
7+
uses: mitlibraries/.github/.github/workflows/python-shared-lint.yml@main

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,4 @@ dmypy.json
155155
cython_debug/
156156

157157
# PyCharm
158-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160-
# and can be added to the global gitignore or merged into this file. For a more nuclear
161-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162-
#.idea/
158+
.idea/

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
default_language_version:
2+
python: python3.12
3+
repos:
4+
- repo: local
5+
hooks:
6+
- id: black-apply
7+
name: black-apply
8+
entry: pipenv run black
9+
language: system
10+
pass_filenames: true
11+
types: ["python"]
12+
- id: mypy
13+
name: mypy
14+
entry: pipenv run mypy
15+
language: system
16+
pass_filenames: true
17+
types: ["python"]
18+
exclude: "tests/"
19+
- id: ruff-apply
20+
name: ruff-apply
21+
entry: pipenv run ruff check --fix
22+
language: system
23+
pass_filenames: true
24+
types: ["python"]
25+
- id: safety
26+
name: safety
27+
entry: pipenv check
28+
language: system
29+
pass_filenames: false

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Makefile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
SHELL=/bin/bash
2+
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
3+
4+
help: # Preview Makefile commands
5+
@awk 'BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
6+
/^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
7+
8+
#######################
9+
# Dependency commands
10+
#######################
11+
12+
install: # Install Python dependencies
13+
pipenv install --dev
14+
pipenv run pre-commit install
15+
16+
update: install # Update Python dependencies
17+
pipenv clean
18+
pipenv update --dev
19+
20+
######################
21+
# Unit test commands
22+
######################
23+
24+
test: # Run tests and print a coverage report
25+
pipenv run coverage run --source=timdex_dataset_api -m pytest -vv
26+
pipenv run coverage report -m
27+
28+
coveralls: test # Write coverage data to an LCOV report
29+
pipenv run coverage lcov -o ./coverage/lcov.info
30+
31+
####################################
32+
# Code quality and safety commands
33+
####################################
34+
35+
lint: black mypy ruff safety # Run linters
36+
37+
black: # Run 'black' linter and print a preview of suggested changes
38+
pipenv run black --check --diff .
39+
40+
mypy: # Run 'mypy' linter
41+
pipenv run mypy .
42+
43+
ruff: # Run 'ruff' linter and print a preview of errors
44+
pipenv run ruff check .
45+
46+
safety: # Check for security vulnerabilities and verify Pipfile.lock is up-to-date
47+
pipenv check
48+
pipenv verify
49+
50+
lint-apply: black-apply ruff-apply # Apply changes with 'black' and resolve 'fixable errors' with 'ruff'
51+
52+
black-apply: # Apply changes with 'black'
53+
pipenv run black .
54+
55+
ruff-apply: # Resolve 'fixable errors' with 'ruff'
56+
pipenv run ruff check --fix .

Pipfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
boto3 = "*"
8+
duckdb = "*"
9+
pandas = "*"
10+
pyarrow = "*"
11+
12+
[dev-packages]
13+
black = "*"
14+
boto3-stubs = {version = "*", extras = ["s3"]}
15+
coveralls = "*"
16+
ipython = "*"
17+
mypy = "*"
18+
pre-commit = "*"
19+
pyarrow-stubs = "*"
20+
pytest = "*"
21+
ruff = "*"
22+
setuptools = "*"
23+
pandas-stubs = "*"
24+
25+
[requires]
26+
python_version = "3.12"

0 commit comments

Comments
 (0)