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

fix: Fix issues with docs, makim/make, release, and CI #182

Merged
merged 13 commits into from
Aug 31, 2023
Merged
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
strategy:
matrix:
smoke_file:
- automation.sh
- auto-format-tools.sh
- build-systems.sh
- containers.sh
Expand Down
42 changes: 22 additions & 20 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
Copyright (c) Open Science Labs and individual contributors.
BSD License

Copyright (c) 2023, Open Science Labs
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Audrey Roy Greenfeld nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
20 changes: 10 additions & 10 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ two alternatives: *src* and *flat*.
subdirectories that represent different modules or packages. Each module or
package within the "src" directory focuses on a specific aspect of the
project's functionality.

For example, a project following the src structure might have the following
layout:

Expand All @@ -215,7 +215,7 @@ two alternatives: *src* and *flat*.
code files directly in the project's root directory without any
subdirectories. This means that all modules and packages are at the same level
and there is no explicit separation between different aspects of the project.

Here's an example of a flat structure:

```python
Expand Down Expand Up @@ -305,7 +305,7 @@ packages. SciCookie support the following:
PEP 517 compilation backend, PEP 621 project metadata, a flexible and
powerful plugin system. It also offers, among other things, versatile
user scripting, PyPI integration and version management.

- [**Hatch**](https://hatch.pypa.io): It's a PEP 517/PEP 660 compatible
build backend used by Hatch, a modern, extensible Python project manager.
It provides a standardized build system with reproducible builds by default,
Expand Down Expand Up @@ -333,7 +333,7 @@ packages. SciCookie support the following:
cross-compilation, and efficient dependency locating with their associated
build requirements. With its capabilities, it facilitates cross-platform
builds using CMake and effortless integration with C/C++ libraries, making
it a valuable asset for research software engineers.
it a valuable asset for research software engineers.

- [**setuptools + pybind11**](https://pybind11.readthedocs.io/en/stable/): It's build system designed
for C++ library that simplifies the creation of Python bindings for C++ code,
Expand All @@ -346,8 +346,8 @@ packages. SciCookie support the following:
support have made it a popular choice for projects requiring seamless interoperability
between C++ and Python, ranging from scientific computing to game development and
automation. Staying up-to-date with the latest pybind11 documentation ensures the
best practices are followed.
best practices are followed.

The idea behind the options in SciCookie is that you can choose from some of the
most popular system compilers to suit your needs and preferences for developing
Python packages. If you think we should add more options, you can submit your
Expand Down Expand Up @@ -770,18 +770,18 @@ by selecting the option `None` (this is the default option).

## Automation Tools
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include it in the structure, please

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, I am not following you here, could you give more details please?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After that line:

- [Integration with DevOps tools](#integration-with-devops-tools)

should be:

- [Automation tools](#automation-tools)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh got it, thank you for the explanation, I am going to add it now. thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!


An automation tool is software or a platform designed to automate repetitive
An automation tool is software or a platform designed to automate repetitive
tasks, processes, or workflows that are traditionally performed manually.
These tools are used to streamline and optimize various operations, reduce
These tools are used to streamline and optimize various operations, reduce
human intervention, increase efficiency, and minimize errors.
Currently SciCookie is using `make` and `Makim`
xmnlab marked this conversation as resolved.
Show resolved Hide resolved

- [Makim](https://osl-incubator.github.io/makim): MakIm is an innovative tool
- [Makim](https://osl-incubator.github.io/makim): Makim is an innovative tool
inspired by Make, designed to simplify target and dependency definition
xmnlab marked this conversation as resolved.
Show resolved Hide resolved
through YAML format. It introduces advanced features such as conditionals,
arguments, and dependencies with targeted parameters. It also facilitates
organized grouping of targets and supports user-defined variables and environment
variables. MakIm empowers users to streamline documentation and parameterize
variables. Makim empowers users to streamline documentation and parameterize
targets effectively. This free and open-source tool offers improved target
management while maintaining compatibility with familiar YAML syntax.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include = [
"scicookie" = "scicookie.__main__:app"

[tool.poetry.dependencies]
python = "^3.8.1"
python = ">=3.8.1,<4"
cookieninja = "1.0.0"
sh = "^2.0.4"
colorama = "^0.4.6"
Expand Down
6 changes: 2 additions & 4 deletions src/scicookie/cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
"sphinx",
"jupyter-book"
],
"automation_tools": [
"Makim",
"Make"
],
"documentation_url": "{{ cookiecutter.project_url }}",
"code_of_conduct": [
"None",
Expand Down Expand Up @@ -63,6 +59,8 @@
"use_black": "yes",
"use_blue": "no",
"use_conda": "yes",
"use_makim": "yes",
"use_make": "no",
"use_containers": [
"None",
"Docker",
Expand Down
2 changes: 2 additions & 0 deletions src/scicookie/profiles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ use_tools:
- flake8
- ruff
- isort
- make
- makim
- mccabe
- mypy
- pre-commit
Expand Down
8 changes: 6 additions & 2 deletions src/scicookie/{{cookiecutter.project_slug}}/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.py]
indent_style = space
indent_size = 4

[*.bat]
indent_style = tab
end_of_line = crlf

[LICENSE]
insert_final_newline = false
insert_final_newline = true

[Makefile]
indent_style = tab

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{%- if not cookiecutter.git_https_upstream -%}
{% set github_url = cookiecutter.git_https_upstream -%}
{%- elif not cookiecutter.git_https_origin -%}
{% set github_url = cookiecutter.git_https_origin -%}
{%- else -%}
{% set github_url = "https://github.com/" + cookiecutter.project_name + "/" + cookiecutter.project_name -%}
{%- endif -%}
---
name: 🐛 Bug Report
description: Create a report to help us improve
Expand All @@ -15,7 +22,7 @@ body:
GitHub][issue search].


[issue search]: https://github.com/{{ cookiecutter.project_name }}/issues?q=is%3Aopen+is%3Aissue+label%3Abug
[issue search]: {{ github_url }}/issues?q=is%3Aopen+is%3Aissue+label%3Abug

- type: textarea
attributes:
Expand Down Expand Up @@ -141,7 +148,7 @@ body:
description: |
Read the [`{{ cookiecutter.project_name }}` Code of Conduct][CoC] first.

[CoC]: https://github.com/{{cookiecutter.project_slug}}/coc/CODE_OF_CONDUCT.md
[CoC]: {{ github_url }}/coc/CODE_OF_CONDUCT.md
options:
- label: I agree to follow the Code of Conduct
required: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{%- if not cookiecutter.git_https_upstream -%}
{% set github_url = cookiecutter.git_https_upstream -%}
{%- elif not cookiecutter.git_https_origin -%}
{% set github_url = cookiecutter.git_https_origin -%}
{%- else -%}
{% set github_url = "https://github.com/" + cookiecutter.project_name + "/" + cookiecutter.project_name -%}
{%- endif -%}
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true
contact_links:
- name: 🙋 Usage Questions
url: https://github.com/{{cookiecutter.project_slug}}/discussions
url: {{ github_url }}/discussions
about: |
Use {{ cookiecutter.project_name }}'s GitHub Discussions to ask "How do I do X with Cookiecutter?".
- name: 📖 Tutorial
url: https://github.com/{{cookiecutter.project_slug}}
url: {{ github_url }}
about: |
The {{ cookiecutter.project_name }} tutorial is continually updated and provides an in depth walkthrough
of how to use the latest release of Cookiecutter.
- name: 📝 {{ cookiecutter.project_name }} Code of Conduct
url: https://github.com/{{cookiecutter.project_slug}}/coc/CODE_OF_CONDUCT.md
url: {{ github_url }}/coc/CODE_OF_CONDUCT.md
about: Expectations for how people will interact with each other on Cookiecutter's GitHub.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{%- if not cookiecutter.git_https_upstream -%}
{% set github_url = cookiecutter.git_https_upstream -%}
{%- elif not cookiecutter.git_https_origin -%}
{% set github_url = cookiecutter.git_https_origin -%}
{%- else -%}
{% set github_url = "https://github.com/" + cookiecutter.project_name + "/" + cookiecutter.project_name -%}
{%- endif -%}
---
name: 📝 Documentation Report
description: Create a report for problems with the docs
Expand All @@ -15,7 +22,7 @@ body:
GitHub][issue search].


[issue search]: https://github.com/{{ cookiecutter.project_name }}/issues?q=is%3Aopen+is%3Aissue+label%3Adocs
[issue search]: {{ github_url }}/issues?q=is%3Aopen+is%3Aissue+label%3Adocs

- type: textarea
attributes:
Expand Down Expand Up @@ -45,7 +52,7 @@ body:
description: |
Read the [`{{ cookiecutter.project_name }}` Code of Conduct][CoC] first.

[CoC]: https://github.com/{{ cookiecutter.project_name }}/blob/main/CODE_OF_CONDUCT.md
[CoC]: {{ github_url }}/blob/main/CODE_OF_CONDUCT.md
options:
- label: I agree to follow the Code of Conduct
required: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{%- if not cookiecutter.git_https_upstream -%}
{% set github_url = cookiecutter.git_https_upstream -%}
{%- elif not cookiecutter.git_https_origin -%}
{% set github_url = cookiecutter.git_https_origin -%}
{%- else -%}
{% set github_url = "https://github.com/" + cookiecutter.project_name + "/" + cookiecutter.project_name -%}
{%- endif -%}
---
name: ✨ Feature Request
description: Suggest an idea for this project
Expand All @@ -17,7 +24,7 @@ body:
already be implemented in a development release.


[issue search]: https://github.com/{{ cookiecutter.project_name }}/issues?q=is%3Aopen+is%3Aissue+label%3Afeat%2Fenhancement
[issue search]: {{ github_url }}/issues?q=is%3Aopen+is%3Aissue+label%3Afeat%2Fenhancement


- type: textarea
Expand Down Expand Up @@ -73,7 +80,7 @@ body:
description: |
Read the [`{{ cookiecutter.project_name }}` Code of Conduct][CoC] first.

[CoC]: https://github.com/{{cookiecutter.project_slug}}/coc/CODE_OF_CONDUCT.md
[CoC]: {{ github_url }}/coc/CODE_OF_CONDUCT.md
options:
- label: I agree to follow the Code of Conduct
required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,30 @@ jobs:
miniforge-variant: Mambaforge

- name: Install dependencies
run: poetry install
run: |
{%- if cookiecutter.build_system == "poetry" %}
poetry install
{%- elif cookiecutter.build_system == "flit" %}
flit install
{%- elif cookiecutter.build_system == "pdm" %}
pdm install
{%- else %}
pip install .
{%- endif %}

- name: Run tests
run: |
{% if cookiecutter.automation_tools == "makim" %}
makim tests.unittest
{% else %}
make test
{% endif %}
{%- if cookiecutter.use_makim == "yes" %}
makim tests.unit
{%- else %}
make test
{%- endif %}

- name: Run style checks
run: |
pre-commit install
{% if cookiecutter.automation_tools == "makim" %}
makim tests.lint
{% else %}
make lint
{% endif %}
{%- if cookiecutter.use_makim == "yes" %}
makim tests.linter
{%- else %}
make lint
{%- endif %}
Loading
Loading