Skip to content

Commit d30915a

Browse files
authored
Pre 2024 DS4CG updates (#13)
* Added some additional info about packaging and dep management options * A note about containers * Updated changelog * Fix typo * Added python 3.12 to github checks * Tagged version 2.0.0 in change log and added python 3.12 to github workflow check
1 parent bb4b813 commit d30915a

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

.github/workflows/python_package.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.10", "3.11"]
15+
python-version: ["3.10", "3.11", "3.12"]
1616

1717
steps:
1818
- uses: actions/checkout@v3

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
You should also add project tags for each release in Github, see [Managing releases in a repository](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
88

9-
## [Unreleased]
9+
## [2.0.0] - 2024-05-29
1010
### Added
1111
- Added example auto-built Sphinx documentation in the `docs` folder
1212
- Github workflow for running ruff linter
13+
- A note about conda dependencies to README
14+
- A note about using docker containers to README
15+
- Ruff as a linter for development
1316
### Changed
1417
- All build and packaging switched to use only pyproject.toml
1518
- Minimum python version changed to 3.10
19+
- Github workflow checks python versions 3.10, 3.11, 3.12
1620
### Removed
1721
- Removed setup.cfg
1822

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This template draws a lot of inspiration from [Cookiecutter Data Science](https:
99
# Getting Started
1010
## Installing Dependencies and Packages
1111
Use these steps for setting up a development environment to install and work with code in this template:
12-
1) Set up a Python 3 virtual environment using [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html#) or [Virtualenv](https://virtualenv.pypa.io/en/latest/index.html). Read [Python Virtual Environments: A Primer](https://realpython.com/python-virtual-environments-a-primer/#the-virtualenv-project) for details on how to get started with virtual environments and why you need them.
12+
1) Set up a Python 3 virtual environment using [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html#) or [Virtualenv](https://virtualenv.pypa.io/en/latest/index.html). Read [Python Virtual Environments: A Primer](https://realpython.com/python-virtual-environments-a-primer/#the-virtualenv-project) for details on how to get started with virtual environments and why you need them. For a _really detailed_ explanation, see [An unbiased evaluation of environment management and packaging tools](https://alpopkes.com/posts/python/packaging_tools/).
1313
2) Activate your virtual environment.
1414

1515
3) Install the package.
@@ -51,11 +51,17 @@ Collecting numpy
5151

5252
## Specifying Requirements
5353
In order for users to install your package and all the libraries it depends on by running `pip install`, you need to provide a `pyproject.toml` file. This has two important sections:
54-
- `project`: List project metadata and version information and all library requirements/dependencies, including for testing or development environments. This is the main file you will work with and add requirements to.
55-
- `build-system`: Define the build tool that is used to package and distribute your code. For this project, we use [SetupTools](https://setuptools.pypa.io/en/latest/userguide/quickstart.html), but we also recommend [Poetry](https://python-poetry.org/docs/).
54+
- `project`: List project metadata and version information and all library requirements/dependencies, including for testing or development environments. This is the main file you will work with and add requirements to. Some dependencies
55+
- `build-system`: Define the build tool that is used to package and distribute your code. For this project, we use [SetupTools](https://setuptools.pypa.io/en/latest/userguide/quickstart.html).
5656

5757
If you'd like to learn more about python packaging, refer to [the Python Packaging User Guide](https://packaging.python.org/en/latest/) or [PEP 517](https://peps.python.org/pep-0517/#build-requirements).
5858

59+
### Requirements via conda environment files
60+
[Anaconda](https://www.anaconda.com/download/) and its bare bones counterpart, [Miniconda](https://docs.anaconda.com/free/miniconda/index.html), are especially useful if your project depends on libraries that are difficult to install in the standard pythonic way, such as [GPU libraries](https://docs.anaconda.com/free/working-with-conda/packages/gpu-packages/). If this is the case, you should also share a [Conda environment file](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-file-manually) with your code. The conda virtual environment will need to be created and activated before any `pip install` steps. Installations with conda dependencies are usually a little more complicated, so make sure you include step-by-step instructions in documentation.
61+
62+
### Containerized applications
63+
In cases when its important that your software work exactly the same on every operating system or you want to abstract away difficult installation steps for end user, you can consider creating a [Docker container](https://www.docker.com/resources/what-container/). This is often appropriate deploying services in the cloud or providing an application for a tech-savvy person to use on their own. However, it's not necessary for most of our projects.
64+
5965

6066
## Directory Structure
6167
So what does each file in this repository do?
@@ -111,7 +117,6 @@ The README, CHANGELOG and docstrings are just as important.
111117
Read [Real Python's Documenting Python Code: A Complete Guide](https://realpython.com/documenting-python-code/) for more ideas about effectively documenting code. The `.md` files are written using [Markdown](https://www.markdownguide.org/), a handy formatting language that is automatically rendered in Github.
112118

113119
# Tests
114-
115120
Although it's [impossible to generally prove that your code is bug-free](https://en.wikipedia.org/wiki/Undecidable_problem), automated testing is a valuable tool. It provides:
116121
- Proof that your code works as intended in most common examples and important edge cases
117122
- Instant feedback on whether changes to the code broke its functionality

src/cdstemplate/word_count.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""An example of an module with functions and a class that can be imported once the package is installed.
2-
This module provides operations for tokenization and tracking cumulative word counts in a set of docuents.
2+
This module provides operations for tokenization and tracking cumulative word counts in a set of documents.
33
"""
44
from collections import Counter
55
import logging

0 commit comments

Comments
 (0)