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

added "make spec" #65

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions {{cookiecutter.project_repo_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ help:
@echo " pep8 to run pep8 code style checks."
@echo "\nSphinx targets:"
@echo " docs to generate HTML documentation with Sphinx."
@echo "\nDeployment targets:"
@echo " spec to generate Conda spec file."

## Anaconda targets
## Conda targets

.PHONY: check_conda
check_conda:
Expand All @@ -50,6 +52,11 @@ envclean: check_conda
@echo "Removing conda env $(CONDA_ENV)"
@-"$(CONDA)" remove -n $(CONDA_ENV) --yes --all

.PHONY: spec
spec: check_conda
@echo "Updating conda environment specification file ..."
@-"$(CONDA)" list -n $(CONDA_ENV) --explicit > spec-file.txt

## Build targets

.PHONY: bootstrap
Expand All @@ -59,7 +66,7 @@ bootstrap: check_conda conda_env bootstrap_dev
.PHONY: bootstrap_dev
bootstrap_dev:
@echo "Installing development requirements for tests and docs ..."
@-bash -c "$(CONDA) install -y -n $(CONDA_ENV) -c conda-forge pytest flake8 sphinx bumpversion"
@-bash -c "$(CONDA) install -y -n $(CONDA_ENV) -c conda-forge pytest flake8 sphinx bumpversion gunicorn psycopg2"
@-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && pip install -r requirements_dev.txt"

.PHONY: install
Expand Down
28 changes: 22 additions & 6 deletions {{cookiecutter.project_repo_name}}/docs/source/dev_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Building the docs

First install dependencies for the documentation:

.. code-block:: sh
.. code-block:: console

$ make bootstrap_dev
$ make docs
Expand All @@ -28,26 +28,26 @@ Run tests using `pytest`_.

First activate the ``{{ cookiecutter.project_slug }}`` Conda environment and install ``pytest``.

.. code-block:: sh
.. code-block:: console

$ source activate {{ cookiecutter.project_slug }}
$ conda install pytest flake8 # if not already installed

Run quick tests (skip slow and online):

.. code-block:: sh
.. code-block:: console

$ pytest -m 'not slow and not online'"

Run all tests:

.. code-block:: sh
.. code-block:: console

$ pytest

Check pep8:

.. code-block:: sh
.. code-block:: console

$ flake8

Expand All @@ -56,12 +56,28 @@ Run tests the lazy way

Do the same as above using the ``Makefile``.

.. code-block:: sh
.. code-block:: console

$ make test
$ make testall
$ make pep8

Prepare a release
-----------------

Update the Conda specification file to build identical environments_ on a specific OS.

.. note:: You should run this on your target OS, in our case Linux.

.. code-block:: console

$ make clean
$ make install
$ make spec

.. _`environments`: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#building-identical-conda-environments


Bump a new version
------------------

Expand Down