diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ef920bb8..16e9048d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -51,5 +51,5 @@ Copy and paste this template for your review's note: - [ ] I managed to reproduce the problem locally from the `main` branch - [ ] I managed to test the new changes locally -- [ ] I confirm that the issues mentioned were fixed/resolved . +- [ ] I confirm that the issues mentioned were fixed/resolved ``` diff --git a/docs/guide.md b/docs/guide.md index e46f7bbc..a3dbd653 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -15,9 +15,9 @@ The structure of the guide is as follows: - [Command-line interfaces (CLIs)](#command-line-interfaces-clis) - [Documentation engine](#documentation-engine) - [Project tools](#project-tools) - - [Virtual Environment](#virtual-environment) + - [Virtual environment](#virtual-environment) - [Code formatter](#code-formatter) - - [Code Security Vulnerabilities](#code-security-vulnerabilities) + - [Code security vulnerabilities](#code-security-vulnerabilities) - [Code coverage testing](#code-coverage-testing) - [Code style and logic (code quality)](#code-style-and-logic-code-quality) - [Testing framework](#testing-framework) @@ -29,7 +29,7 @@ The structure of the guide is as follows: - [Code of conduct](#code-of-conduct) - [Governance document](#governance-document) - [Roadmap document](#roadmap-document) - - [Control Version](#control-version) + - [Version control](#version-control) ## Notes about the text-based user interface (TUI) @@ -449,7 +449,7 @@ errors and vulnerabilities in your code, and much more. The tools are described below according to their functionality. -### Virtual Environment +### Virtual environment When working with Python, you should always have a virtual environment. This is an isolated space where you can install and run applications and @@ -473,6 +473,11 @@ community. is a good option. It is included in all versions of Anaconda and Miniconda. + If you select this option, a conda folder will appear in the project + directory, containing a dev.yaml file that you can use to manage the + development project's dependencies. If you do not select this option, a + requirements.txt will be added for you to manage with virtualenv. + ### Code formatter A code formatter is a tool that automatically reformats code to conform to a set @@ -510,7 +515,7 @@ process will be stopped. Using code formatters such as *Black* or *Blue* in your project helps ensure consistent and readable code, making it easier to maintain and collaborate on. -### Code Security Vulnerabilities +### Code security vulnerabilities The code security vulnerabilities are errors or weaknesses in code that can be exploited by attackers to gain unauthorized access, steal data, or cause damage @@ -769,7 +774,7 @@ In case you do not want to include DevOps in your project, you can do so by selecting the option `None` (this is the default option). -## Automation Tools +## Automation tools An automation tool is software or a platform designed to automate repetitive tasks, processes, or workflows that are traditionally performed manually. @@ -896,7 +901,7 @@ Ignite Roadmap, click [here](https://github.com/pytorch/ignite/wiki/Roadmap). In case you do not want to include this file in your project, you can do so by selecting the option `None` (this is the default option). -## Control Version +## Version control Version control is essential for any project because it enables us to track and store all versions and changes made to our codebase. With this in mind, we have diff --git a/src/scicookie/hooks/post_gen_project.py b/src/scicookie/hooks/post_gen_project.py index 515c6245..c670aa25 100644 --- a/src/scicookie/hooks/post_gen_project.py +++ b/src/scicookie/hooks/post_gen_project.py @@ -138,7 +138,11 @@ def clean_up_code_of_conduct(): def clean_up_conda(): if not USE_CONDA: - remove_dir("conda") + shutil.move(PROJECT_DIRECTORY / "virtualenvs" / "pyenv" / "requirements.txt", PROJECT_DIRECTORY) + remove_dir("virtualenvs") + else: + shutil.move(PROJECT_DIRECTORY / "virtualenvs" / "conda", PROJECT_DIRECTORY) + remove_dir("virtualenvs") def clean_up_governance(): diff --git a/src/scicookie/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md b/src/scicookie/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md index ef920bb8..16e9048d 100644 --- a/src/scicookie/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md +++ b/src/scicookie/{{cookiecutter.project_slug}}/.github/PULL_REQUEST_TEMPLATE.md @@ -51,5 +51,5 @@ Copy and paste this template for your review's note: - [ ] I managed to reproduce the problem locally from the `main` branch - [ ] I managed to test the new changes locally -- [ ] I confirm that the issues mentioned were fixed/resolved . +- [ ] I confirm that the issues mentioned were fixed/resolved ``` diff --git a/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/main.yaml b/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/main.yaml index ea393e01..6048c79b 100644 --- a/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/main.yaml +++ b/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/main.yaml @@ -16,6 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 +{% if cookiecutter.use_conda == "yes" %} - uses: conda-incubator/setup-miniconda@v2 with: miniconda-version: "latest" @@ -26,6 +27,18 @@ jobs: activate-environment: {{ cookiecutter.project_slug }} use-mamba: true miniforge-variant: Mambaforge +{% else %} + + - uses: actions/checkout@v3 + with: + python-version : "pypy3.9" + + - name: Create virtual environment + run: source {{ cookiecutter.project_slug }}/bin/activate + + - name: Install build-system + run: pip install -r requests.txt +{%- endif %} - name: Install dependencies run: | diff --git a/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/release.yaml b/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/release.yaml index 9beaa606..8e6f0109 100644 --- a/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/release.yaml +++ b/src/scicookie/{{cookiecutter.project_slug}}/.github/workflows/release.yaml @@ -24,6 +24,7 @@ jobs: steps: - uses: actions/checkout@v3 +{% if cookiecutter.use_conda == "yes" %} - uses: conda-incubator/setup-miniconda@v2 with: @@ -35,6 +36,20 @@ jobs: activate-environment: {{ cookiecutter.project_slug }} use-mamba: true miniforge-variant: Mambaforge +{% else %} + - uses: actions/setup-python@v4 + with: + python-version: "pypy3.9" + + - name: Create virtual environment + run: python -m venv {{ cookiecutter.project_slug }} + + - name: Activate virtual environment + run: source {{ cookiecutter.project_slug }}/bin/activate + + - name: Install build-system + run: pip install -r requests.txt +{% endif %} - name: Install deps run: | diff --git a/src/scicookie/{{cookiecutter.project_slug}}/conda/dev.yaml b/src/scicookie/{{cookiecutter.project_slug}}/virtualenvs/conda/dev.yaml similarity index 100% rename from src/scicookie/{{cookiecutter.project_slug}}/conda/dev.yaml rename to src/scicookie/{{cookiecutter.project_slug}}/virtualenvs/conda/dev.yaml diff --git a/src/scicookie/{{cookiecutter.project_slug}}/virtualenvs/pyenv/requirements.txt b/src/scicookie/{{cookiecutter.project_slug}}/virtualenvs/pyenv/requirements.txt new file mode 100644 index 00000000..fa34b7cc --- /dev/null +++ b/src/scicookie/{{cookiecutter.project_slug}}/virtualenvs/pyenv/requirements.txt @@ -0,0 +1,37 @@ +python < 3.11 +{%- if cookiecutter.build_system == "poetry" %} +poetry +{%- elif cookiecutter.build_system == "flit" %} +flit +{%- elif cookiecutter.build_system == "mesonpy" %} +meson-python +{%- elif cookiecutter.build_system == "setuptools" %} +setuptools +build +{%- elif cookiecutter.build_system == "pdm" %} +pdm +{%- elif cookiecutter.build_system == "hatch" %} +hatch +{%- elif cookiecutter.build_system == "maturin" %} +maturin +rust +{%- elif cookiecutter.build_system == "scikit-build-core" %} +scikit-build-core +cmake +{%- elif cookiecutter.build_system == "pybind11" %} +pybind11 +cmake +{%- endif %} +nodejs # used by semantic-release +{%- if cookiecutter.use_shellcheck == "yes" %} +shellcheck +{%- endif %} +{%- if cookiecutter.documentation_engine == "sphinx" %} +pandoc +{%- endif %} +{%- if cookiecutter.use_mypy == "yes" %} +mypy +{%- endif %} +{%- if cookiecutter.use_make == "yes" %} +make +{%- endif %}