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

[WIP] Version 2 #246

Merged
merged 37 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1fe968d
[WIP] New version with cleaner options (#162)
pjbull Mar 20, 2021
4cbf452
docs: add dev-requirements, remove tox.ini (#254)
tgrrr Mar 4, 2022
ea0f21a
Formatting
pjbull Aug 2, 2022
4cfe2cb
Docs and test cleanup
pjbull Aug 2, 2022
ef2e840
3.10 specificaiton
pjbull Aug 2, 2022
a7badf2
Passing tests and lint
pjbull Aug 2, 2022
04d0071
testing improvements and hooks refactor
pjbull Aug 5, 2022
227eaaf
Lint, format, license (#247)
tamara-glazer Aug 5, 2022
c3fe711
Updating the Makefile
AllenDowney Oct 13, 2022
d12f218
Merge pull request #287 from drivendata/update-makefile
AllenDowney Oct 13, 2022
fa6c5de
Removing deprecation message from v2
AllenDowney Oct 13, 2022
b4c0c12
Merge pull request #288 from drivendata/remove-deprecation-message
AllenDowney Oct 13, 2022
24593e5
update pip, reqs, test CI commands
pjbull Jan 28, 2023
b5dacb2
Update docs build
pjbull Jan 28, 2023
a723ae4
Revert netlify changes
pjbull Jan 28, 2023
851c922
Use default netlify build runtime
pjbull Jan 28, 2023
4d04432
make gsutil rsync recursive (#297)
KBodolai Mar 16, 2023
6968c2a
V2 bug fixes, modernization, house-keeping, and README update (#313)
jayqi Aug 31, 2023
f5fc742
Add windows to CI (#319)
jayqi Sep 5, 2023
c3f1c14
Optionally remove boilerplate in initial setup (#286)
chrisjkuch Oct 13, 2023
e5b1183
Replace sphinx with mkdocs as default docs option, add none option (#…
chrisjkuch Dec 1, 2023
b0c3758
Create new screencast automatically on docs build (#339)
pjbull Dec 29, 2023
8aa2417
Update Makefile help command to work on all platforms (#335)
chrisjkuch Jan 11, 2024
0f5c33b
Update docs to material theme (#341)
chrisjkuch Jan 14, 2024
2ba59a9
write to tempfile instead of hardcoded dir to prevent unintended pers…
chrisjkuch Jan 16, 2024
8403c0d
Merge pull request #343 from drivendata/fix-termynal-gen
chrisjkuch Jan 17, 2024
1522f3f
Update docs to use multiple pages (#344)
chrisjkuch Jan 24, 2024
6a1374e
Add workflows for Python 3.12 (#329)
chrisjkuch Jan 30, 2024
e51553f
Update opinions (#345)
chrisjkuch Mar 2, 2024
6b9eb7c
Badge + docs updates (#348)
pjbull Mar 16, 2024
aa6e529
Minor CSS Tweaks (#349)
chrisjkuch Mar 19, 2024
4f9038d
Add commandline options table (#350)
pjbull Apr 1, 2024
644bae7
Use shutil.copytree instead of distutils (#353)
jayqi Apr 5, 2024
39a6cad
Add documentation about Make on Windows (#355)
jayqi Apr 7, 2024
df8b5d3
V2 Modernize boilerplate (#354)
jayqi Apr 15, 2024
0e9ce41
Updates from review of V2 docs (#362)
pjbull May 22, 2024
58fb5da
Merge branch 'master' into v2
pjbull May 22, 2024
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
117 changes: 117 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

name: tests

on:
push:
branches: [master, v2]
paths-ignore: "docs/**"
pull_request:
branches: [master, v2]
paths-ignore: "docs/**"
schedule:
# Run every Sunday
- cron: "0 0 * * 0"
workflow_dispatch:

jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
pyproject.toml
dev-requirements.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
make requirements

- name: Lint
run: |
make lint

tests:
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
needs: code-quality
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: "pip"
cache-dependency-path: |
pyproject.toml
dev-requirements.txt

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
activate-environment: ""

- name: Cache conda packages
uses: actions/cache@v4
env:
# Increase this value to reset cache explicitly
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('ccds/hook_utils/dependencies.py') }}

- name: Setup for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
# Install GNU make
choco install --verbose make
# Add conda binaries directory to PATH so that conda is accessible
echo "${CONDA}\Scripts" >> $GITHUB_PATH
# Set bash executable explicitly since Make may pick wrong shell
echo "BASH_EXECUTABLE=$(which bash)" >> "$GITHUB_ENV"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
make requirements

- name: Check dependencies
run: |
if [[ -z "${BASH_EXECUTABLE}" ]]; then
bash --version
else
echo $BASH_EXECUTABLE
$BASH_EXECUTABLE --version
fi
which make
make --version
which conda
conda --version
which pipenv
pipenv --version
which virtualenv
virtualenv --version

- name: Run tests
run: |
make test
178 changes: 173 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,177 @@
# generated docs items
docs/site/
docs/docs/_partials/termynal.md
docs/docs/_partials/*/*.html

# OSX Junk
# test cache
manual_test/

# other local dev info
.vscode/

# Mac OS-specific storage files
.DS_Store

# test cache
.cache/*
tests/__pycache__/*
*.pytest_cache/
# vim
*.swp
*.swo

## https://github.com/github/gitignore/blob/4488915eec0b3a45b5c63ead28f286819c0917de/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
66 changes: 66 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.PHONY: _prep create_environment requirements format lint docs docs-serve test \
test-fastest test-debug-fastest _clean_manual_test manual-test manual-test-debug

## GLOBALS

PROJECT_NAME = cookiecutter-data-science
PYTHON_VERSION = 3.10
PYTHON_INTERPRETER = python


### UTILITIES
_prep:
rm -f **/*/.DS_store


### DEV COMMANDS

## Set up python interpreter environment
create_environment:
conda create --name $(PROJECT_NAME) python=$(PYTHON_VERSION) -y
@echo ">>> conda env created. Activate with:\nconda activate $(PROJECT_NAME)"

## Install Python Dependencies
requirements:
$(PYTHON_INTERPRETER) -m pip install -r dev-requirements.txt

## Format the code using isort and black
format:
isort --profile black ccds hooks tests docs/scripts
black ccds hooks tests docs/scripts

lint:
flake8 ccds hooks tests docs/scripts
isort --check --profile black ccds hooks tests docs/scripts
black --check ccds hooks tests docs/scripts


### DOCS

docs:
cd docs && mkdocs build

docs-serve:
cd docs && mkdocs serve

### TESTS

test: _prep
pytest -vvv --durations=0

test-fastest: _prep
pytest -vvv -FFF

test-debug-last:
pytest --lf --pdb

_clean_manual_test:
rm -rf manual_test

manual-test: _prep _clean_manual_test
mkdir -p manual_test
cd manual_test && python -m ccds ..

manual-test-debug: _prep _clean_manual_test
mkdir -p manual_test
cd manual_test && python -m pdb ../ccds/__main__.py ..
Loading
Loading