From de751c55cd9a5df586e3d961535292cfb73e0397 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 23 Nov 2023 14:34:21 -0500 Subject: [PATCH 1/4] adjust flit usage --- docs/console_script_setup.rst | 6 ++++-- docs/pypi_release_checklist.rst | 2 +- {{cookiecutter.project_slug}}/CONTRIBUTING.rst | 4 ++-- {{cookiecutter.project_slug}}/Makefile | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/console_script_setup.rst b/docs/console_script_setup.rst index 48d76b728..cc60dba3b 100644 --- a/docs/console_script_setup.rst +++ b/docs/console_script_setup.rst @@ -17,7 +17,8 @@ To use the console script in development: .. code-block:: bash - python -m flit install --symlink projectdir + cd projectdir + flit install --symlink 'projectdir' should be the top level project directory with the `pyproject.toml` file @@ -38,7 +39,8 @@ will not necessarily create an editable install. This is a known issue with `fli .. code-block:: bash - python -m flit install --symlink projectdir + cd projectdir + flit install --symlink More Details ------------ diff --git a/docs/pypi_release_checklist.rst b/docs/pypi_release_checklist.rst index ebeb96a08..b863d028a 100644 --- a/docs/pypi_release_checklist.rst +++ b/docs/pypi_release_checklist.rst @@ -32,7 +32,7 @@ For Every Release .. code-block:: bash - python -m flit install --symlink . + flit install --symlink #. Run the tests: diff --git a/{{cookiecutter.project_slug}}/CONTRIBUTING.rst b/{{cookiecutter.project_slug}}/CONTRIBUTING.rst index 29cae0dd2..7afd5e502 100644 --- a/{{cookiecutter.project_slug}}/CONTRIBUTING.rst +++ b/{{cookiecutter.project_slug}}/CONTRIBUTING.rst @@ -65,7 +65,7 @@ Ready to contribute? Here's how to set up ``{{ cookiecutter.project_slug }}`` fo $ mamba env create -f environment-dev.yml $ conda activate {{ cookiecutter.project_slug }} - $ flit install --symlink . + $ flit install --symlink {%- else -%} Using ``virtualenv`` (``virtualenvwrapper``), you can create a new development environment with:: @@ -73,7 +73,7 @@ Ready to contribute? Here's how to set up ``{{ cookiecutter.project_slug }}`` fo $ python -m pip install flit virtualenvwrapper $ mkvirtualenv {{ cookiecutter.project_slug }} $ cd {{ cookiecutter.project_slug }}/ - $ flit install --symlink . + $ flit install --symlink {%- endif %} #. To ensure a consistent style, please install the pre-commit hooks to your repo:: diff --git a/{{cookiecutter.project_slug}}/Makefile b/{{cookiecutter.project_slug}}/Makefile index 294c26a4e..7fc6767b7 100644 --- a/{{cookiecutter.project_slug}}/Makefile +++ b/{{cookiecutter.project_slug}}/Makefile @@ -114,7 +114,7 @@ release: dist ## package and upload a release python -m flit publish dist/* install: clean ## install the package to the active Python's site-packages - python -m flit install . + python -m flit install dev: clean ## install the package to the active Python's site-packages - python -m flit install --symlink . + python -m flit install --symlink From 55c2dc118fe0eb626f94f57b9052debaa6176b6a Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:06:14 -0500 Subject: [PATCH 2/4] remove recursive glob patterns in include/exclude --- {{cookiecutter.project_slug}}/pyproject.toml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index af0e3698d..87fe5e76d 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -157,23 +157,24 @@ include = [ {%- endif %} "Makefile", "README.rst", + "environment-dev.yml" {%- if cookiecutter.make_docs == 'y' %} - "docs/**/*.gif", - "docs/**/*.jpg", - "docs/**/*.png", - "docs/**/*.rst", + "environment-docs.yml", + "docs/_static/_images/*.gif", + "docs/_static/_images/*.jpg", + "docs/_static/_images/*.png", + "docs/_static/_images/*.rst", "docs/Makefile", "docs/conf.py", "docs/make.bat", {%- endif %} - "setup.cfg", "tests/*.py", "tox.ini", - "{{ cookiecutter.project_slug }}/**/*.py" + "{{ cookiecutter.project_slug }}" ] exclude = [ - "**/*.py[co]", - "**/__pycache__", + "*.py[co]", + "__pycache__", ".coveralls.yml", ".editorconfig", ".flake8", @@ -183,14 +184,11 @@ exclude = [ ".readthedocs.yml", {% endif -%} ".yamllint.yaml", - "Makefile", {%- if cookiecutter.make_docs == 'y' %} "docs/_*", "docs/modules.rst", "docs/{{ cookiecutter.project_slug }}*.rst", - "environment-docs.yml", {% endif -%} - "environment-dev.yml" ] {%- if cookiecutter.use_black == 'y' %} From 58b13f0c37691917bc5089ee2ff7c650dede5b06 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:23:34 -0500 Subject: [PATCH 3/4] finishing touches --- {{cookiecutter.project_slug}}/pyproject.toml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 87fe5e76d..65661fdb5 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -157,7 +157,9 @@ include = [ {%- endif %} "Makefile", "README.rst", - "environment-dev.yml" + {%- if cookiecutter.use_conda == 'y' %} + "environment-dev.yml", + {%- endif %} {%- if cookiecutter.make_docs == 'y' %} "environment-docs.yml", "docs/_static/_images/*.gif", @@ -183,12 +185,13 @@ exclude = [ {%- if cookiecutter.make_docs == 'y' %} ".readthedocs.yml", {% endif -%} - ".yamllint.yaml", - {%- if cookiecutter.make_docs == 'y' %} + ".yamllint.yaml" + {%- if cookiecutter.make_docs == 'y' -%} + , "docs/_*", "docs/modules.rst", - "docs/{{ cookiecutter.project_slug }}*.rst", - {% endif -%} + "docs/{{ cookiecutter.project_slug }}*.rst" + {%- endif %} ] {%- if cookiecutter.use_black == 'y' %} From 65a4313b060df132d83623006c5d7241ba734d9b Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:40:42 -0500 Subject: [PATCH 4/4] specify apidoc folder --- {{cookiecutter.project_slug}}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 65661fdb5..50845785c 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -189,8 +189,8 @@ exclude = [ {%- if cookiecutter.make_docs == 'y' -%} , "docs/_*", - "docs/modules.rst", - "docs/{{ cookiecutter.project_slug }}*.rst" + "docs/apidoc/modules.rst", + "docs/apidoc/{{ cookiecutter.project_slug }}*.rst" {%- endif %} ] {%- if cookiecutter.use_black == 'y' %}