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] New version with cleaner options #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pjbull. Approving general direction of edits on this WIP PR, seems like this hits many of the customization requests that we have been getting and is a reasonable workaround for the cookiecutter limitations.
I would suggest changing |
|
Ah yes. Good point. Just found it a little counter-intuitive at first. |
Are there any updates regarding this pull request? The master branch is quite outdated and I think this pull request adds a lot of value and addresses many open issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should check for this file also https://github.com/drivendata/cookiecutter-data-science/blob/new-cli/%7B%7B%20cookiecutter.repo_name%20%7D%7D/docs/commands.rst.
`
{% if 's3' in cookiecutter.dataset_storage %}
Syncing data to S3
^^^^^^^^^^^^^^^^^^
make sync_data_to_s3
will useaws s3 sync
to recursively sync files indata/
up tos3://{{ cookiecutter.s3_bucket }}/data/
.make sync_data_from_s3
will useaws s3 sync
to recursively sync files froms3://{{ cookiecutter.s3_bucket }}/data/
todata/
.
{% endif %}
`
Or perhaps you can expect this to change upstream: New maintainier. Cookiecutter 2.0 coming. cookiecutter/cookiecutter#1256 |
I've got a decent head of steam on a comprehensive set of tests we needed anyway for this change (and for the project generally). I'll keep going to get all the environment options tested on all platforms and then we can assess what to look to cookiecutter for and what to do ourselves. The biggest decision is whether this becomes a tool where you have to do |
* Change archived asciinema example (#163) * Change archived asciinema example * Update README.md Fix Asciinema powerline error * Update docs to show updated asciinema example * Added source and destination to Make data target (#169) * Fix broken Airflow link (#182) * Fixed: Typo in Makefile (#184) Fixed typo in Makefile, section "Set up python interpreter environment": intalled --> installed * Set up CI with Azure Pipelines [skip ci] * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * str paths for windows support * handle multiple data providers (#199) * Add missing env directory bin/activate path * Remove version from PYTHON_INTERPRETER command * Search for virtualenvwrapper.sh path if executable not found * Try chardet for character encoding detection * Specify python and virtualenv binaries for virtualenvwrapper * Add shebang to virtualenvwrapper.sh * Diagnostic * Try virtualenvwrapper-win * Set encoding if detected None * Fixes to Mac and Windows tests on Azure pipelines (#217) * Temporarily comment out py36 * Update azure-pipelines.yml * Fix tests on Windows and Mac (#1) * Temporarily remove py37 * Update virtualenv_harness.sh * put py37 back in * Set encoding to utf-8 * Comment out rmvirtualenv * Update test_creation.py * Update virtualenv_harness.sh * Add --show-capture * Update azure-pipelines.yml * Update azure-pipelines.yml * Update test_creation.py * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update Makefile * Update virtualenv_harness.sh * Update cookiecutter.json * Update cookiecutter.json * Update virtualenv_harness.sh * Update Makefile * Update Makefile * Update Makefile * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update Makefile * Update Makefile * Update virtualenv_harness.sh * Update Makefile * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update test_creation.py * Update azure-pipelines.yml * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update cookiecutter.json * Update conda_harness.sh * Update conda_harness.sh * Update conda_harness.sh Co-authored-by: Eric Jalbert <ericmjalbert@users.noreply.github.com> Co-authored-by: Jonathan Raviotta <jraviotta@users.noreply.github.com> Co-authored-by: Wes Roach <wesr000@gmail.com> Co-authored-by: Christopher Geis <16896724+geisch@users.noreply.github.com> Co-authored-by: Peter Bull <pjbull@gmail.com> Co-authored-by: Ian Preston <17241371+ianepreston@users.noreply.github.com> Co-authored-by: Jay Qi <jayqi@users.noreply.github.com> Co-authored-by: inchiosa <4316698+inchiosa@users.noreply.github.com>
Add netlify configs
Publish docs with Netlify
Moving this work on to an official |
* WIP - New version with cleaner options * Fix find-replace error (drivendata#177) * Remove unnecessary .gitkeep * Remove unused tox.ini * Split reqs into dev/non-dev * Add basic packages support * Add tests for testing environment creation and requirements * Set up CI with Azure Pipelines (drivendata#194) * Change archived asciinema example (drivendata#163) * Change archived asciinema example * Update README.md Fix Asciinema powerline error * Update docs to show updated asciinema example * Added source and destination to Make data target (drivendata#169) * Fix broken Airflow link (drivendata#182) * Fixed: Typo in Makefile (drivendata#184) Fixed typo in Makefile, section "Set up python interpreter environment": intalled --> installed * Set up CI with Azure Pipelines [skip ci] * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * Update azure-pipelines.yml for Azure Pipelines * str paths for windows support * handle multiple data providers (drivendata#199) * Add missing env directory bin/activate path * Remove version from PYTHON_INTERPRETER command * Search for virtualenvwrapper.sh path if executable not found * Try chardet for character encoding detection * Specify python and virtualenv binaries for virtualenvwrapper * Add shebang to virtualenvwrapper.sh * Diagnostic * Try virtualenvwrapper-win * Set encoding if detected None * Fixes to Mac and Windows tests on Azure pipelines (drivendata#217) * Temporarily comment out py36 * Update azure-pipelines.yml * Fix tests on Windows and Mac (#1) * Temporarily remove py37 * Update virtualenv_harness.sh * put py37 back in * Set encoding to utf-8 * Comment out rmvirtualenv * Update test_creation.py * Update virtualenv_harness.sh * Add --show-capture * Update azure-pipelines.yml * Update azure-pipelines.yml * Update test_creation.py * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update Makefile * Update virtualenv_harness.sh * Update cookiecutter.json * Update cookiecutter.json * Update virtualenv_harness.sh * Update Makefile * Update Makefile * Update Makefile * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update Makefile * Update Makefile * Update virtualenv_harness.sh * Update Makefile * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update test_creation.py * Update azure-pipelines.yml * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update virtualenv_harness.sh * Update cookiecutter.json * Update conda_harness.sh * Update conda_harness.sh * Update conda_harness.sh Co-authored-by: Eric Jalbert <ericmjalbert@users.noreply.github.com> Co-authored-by: Jonathan Raviotta <jraviotta@users.noreply.github.com> Co-authored-by: Wes Roach <wesr000@gmail.com> Co-authored-by: Christopher Geis <16896724+geisch@users.noreply.github.com> Co-authored-by: Peter Bull <pjbull@gmail.com> Co-authored-by: Ian Preston <17241371+ianepreston@users.noreply.github.com> Co-authored-by: Jay Qi <jayqi@users.noreply.github.com> Co-authored-by: inchiosa <4316698+inchiosa@users.noreply.github.com> * More graceful deprecation * Make tests pass locally * test version match installed version * Remove unused imports * Unremove used import * Move to GH Actions * Fix typo * Test non-windows * Add netlify configs * Update suggestion to keep using deprecated cookiecutter template (drivendata#231) * Add mkdocs requirements file to docs directory * Try setting python version in runtime txt for netlify * Trigger build * Python 3.8 netlify * Python 3.6 netlify * Do not specify python runtime for netlify * Use 3.7 This reverts commit 898d7d3. Co-authored-by: James Myatt <james@jamesmyatt.co.uk> Co-authored-by: drivendata <info@drivendata.org> Co-authored-by: Eric Jalbert <ericmjalbert@users.noreply.github.com> Co-authored-by: Jonathan Raviotta <jraviotta@users.noreply.github.com> Co-authored-by: Wes Roach <wesr000@gmail.com> Co-authored-by: Christopher Geis <16896724+geisch@users.noreply.github.com> Co-authored-by: Ian Preston <17241371+ianepreston@users.noreply.github.com> Co-authored-by: Jay Qi <jayqi@users.noreply.github.com> Co-authored-by: inchiosa <4316698+inchiosa@users.noreply.github.com> Co-authored-by: Robert Gibboni <robert@drivendata.org>
We've seen a lot of potential features for this where we need to handle forking paths gracefully. By default
cookiecutter
can't do this (see cookiecutter/cookiecutter#848). It's been years, so we can't reasonably expect this to change upstream...This implements a monkey-patching workaround to enable this behavior. It introduces a couple of major changes, so here are my recommendations.
Here are the big differences for a user:
ccds <path to repo>
instead ofcookiecutter <path to repo>
make create_environment
will only support one of the options rather than multiple like it does now)Implementation details are:
setup.py
to make this package installable and give it a CLImonkey_patch.py
to patch thecookiecutter
functions that we need to handle our use casecookiecutter.json
that let's a use pick an option and then sub-optionspost_gen_project.py
to create the environment file based on a standard list of libraries. (Add package list that populatesrequirements.txt
to the workflow #5)There is also work for a number of longstanding items in this branch as well:
src
is now{{ cookiecutter.module_name }}
(Renamesrc
directory toproject_name
#140)test_environment.py
which is just cruft IMODone:
v1
so anyone relying on the current flow/structure can continue to use it easilyccds
command and makecookiecutter-data-science
a proper packageRemaining items
Cookiecutter default structure
lint
command toMakefile
Cookiecutter options
black
)pytest
install andmake
commands)Infrastructure
Docs
pip install cookiecutter-data-science
) and new initiation (ccds <path to repo>
)