You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+51-13
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Inspired by [literate programming](http://literateprogramming.com), maintained b
33
33
-**notebooks/**
34
34
> Placeholder folder for [Jupyter notebooks](https://jupyter.org). Markdown files and Jupyter notebooks can be added to `docs/_toc.yml` (Table of Contents) to compose the *documentation*.
> Using [pre-commit](https://pre-commit.com) offers a significant advantage in streamlining the development process by enforcing code standards and reducing errors before code reaches the review stage or is committed to the repository. It automates the execution of various checks, such as syntax errors, code formatting, and ensuring compliance with coding standards, which saves time and improves code quality.
38
38
39
39
-[GitHub Actions](https://github.com/features/actions) and [Dependabot](https://docs.github.com/en/code-security/dependabot)
@@ -170,9 +170,16 @@ The <span style="color:#3EACAD">template</span> is licensed under the [**Mozilla
@@ -234,18 +241,31 @@ By default, Jupyter notebooks are **not** executed. However, you can configure[J
234
241
[Jupyter Book Write executable content](https://jupyterbook.org/en/stable/content/executable/index.html)
235
242
```
236
243
237
-
### Use `pyproject.toml` for Python Package Management
244
+
#### Distributing Your Project as a Python Package
245
+
246
+
If your project uses [Python](https://python.org), it’s highly recommended to distribute it as a [package](https://packaging.python.org/en/latest/tutorials/packaging-projects/). By including a `pyproject.toml` file, the packaging process becomes more streamlined - *trust me [things can get intense](https://imgs.xkcd.com/comics/python_environment.png)*.
247
+
248
+
Additionally:
249
+
250
+
```{tip}
251
+
- Using `pyproject.toml` future-proofs your setup by aligning with modern packaging standards.
252
+
- The `pyproject.toml` file acts as a single source of truth for your Python dependencies and project metadata.
253
+
- You can combine Conda for system-level dependencies with `pyproject.toml` for Python dependencies, using Conda for environments and pip/poetry for Python packages.
254
+
- Any packages in the `src/` folder will be automatically discovered and installed.
255
+
```
256
+
257
+
##### Use `pyproject.toml` for Python Package Management
238
258
239
259
While the <spanstyle="color:#3EACAD">template</span> recommends using [Conda](https://conda.io/projects/conda/en/latest/index.html) (or [Mamba](https://github.com/mamba-org/mamba)) as the environment manager and managing dependencies through an `environment.yml` file, there is an alternative approach that leverages `pyproject.toml`. This can be particularly advantageous if your project is a Python package or if you want to simplify and standardize the management of Python-specific dependencies.
240
260
241
-
#### Why use `pyproject.toml`?
261
+
#####Why use `pyproject.toml`?
242
262
243
263
The next step is ensure your code is maintainable, reliable and reproducible by including
244
264
any dependencies and requirements, such as packages, configurations, secrets (template) and additional instructions.
245
265
246
266
1.**Standardization**: `pyproject.toml` is a modern, standardized format defined by [PEP 518](https://peps.python.org/pep-0518/) and [PEP 621](https://peps.python.org/pep-0621/) that centralizes project configuration in Python projects, including build requirements and dependencies.
247
267
248
-
2.**Python Packaging**: If your project is to be distributed as a package, `pyproject.toml` is the preferred way to define build tools (like `setuptools` or `poetry`) and metadata for your package (like name, version, dependencies, etc.). It allows tools like `pip` and `build` to install and package your project more effectively.
268
+
2.**Python Packaging**: If your project is to be distributed as a package, `pyproject.toml` is the preferred way to define build tools (like [hatch](https://hatch.pypa.io/latest/config/dependency/) or [poetry](https://python-poetry.org)) and metadata for your package (like name, version, dependencies, etc.). It allows tools like `pip` and `build` to install and package your project more effectively.
249
269
250
270
3.**Compatibility with Tools**: The `pyproject.toml` file is compatible with multiple Python packaging and dependency management tools such as `poetry` and `pip`. This allows for smoother integration with CI/CD pipelines, PyPI, and other environments.
251
271
@@ -304,7 +324,7 @@ This `pyproject.toml` file specifies the dependencies and other metadata for you
304
324
```
305
325
306
326
3. **Installation**:
307
-
To create an environment, you would first install the Conda dependencies and then use `pip` to install Python-specific dependencies from `pyproject.toml`. Alternatively, you can skip Conda and use `pip` for the entire setup.
327
+
To create an environment, you would first install the Conda dependencies and then use `pip` to install Python-specific dependencies from `pyproject.toml`. Alternatively, you can skip Conda and use `pip` for the entire setup.
308
328
309
329
```shell
310
330
# Create Conda environment
@@ -317,20 +337,38 @@ This `pyproject.toml` file specifies the dependencies and other metadata for you
317
337
pip install .
318
338
```
319
339
320
-
#### Distributing Your Project as a Python Package
340
+
To install a Python package directly from a [GitHub](https://github.com) repository using [pip](https://pip.pypa.io/en/stable/installation/), you can use the command pip install `git+https://github.com/<username>/<repository>.git`. This allows you to install the latest version of the package from the repository. You can also specify a particular branch or release tag by adding `@<branch_or_tag>` at the end of the URL This is particularly useful when you want to access features or fixes that haven’t been published on PyPI yet, or to get the latest updates from the repository.
321
341
322
-
If your project uses [Python](https://python.org), it’s highly recommended to distribute it as a [package](https://packaging.python.org/en/latest/tutorials/packaging-projects/). By including a `pyproject.toml` file, the packaging process becomes more streamlined. Additionally:
342
+
If you want to install the latest release, you should specify the tag associated with that release. For instance:
323
343
324
-
- The `pyproject.toml` file acts as a single source of truth for your Python dependencies and project metadata.
325
-
- Any packages in the `src/` folder will be automatically discovered and installed.
326
-
- Using `pyproject.toml` future-proofs your setup by aligning with modern packaging standards.
327
-
-You can combine Conda for system-level dependencies with `pyproject.toml` for Python dependencies, using Conda for environments and Pip/Poetry for Python packages.
The generated documentation will be available in the `_build/html` directory. Open the `index.html` file in a web browser to view it.
371
+
334
372
## Code of Conduct
335
373
336
374
The <spanstyle="color:#3EACAD">template</span> maintains a [Code of Conduct](docs/CODE_OF_CONDUCT.md) to ensure an inclusive and respectful environment for everyone. Please adhere to it in all interactions within our community.
0 commit comments