Skip to content

Commit 59e3d30

Browse files
authored
Merge pull request #92 from UBC-MDS/otter
Create release 3.0.0
2 parents b481e9f + 86a40e2 commit 59e3d30

File tree

15 files changed

+393
-44
lines changed

15 files changed

+393
-44
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@ jobs:
5757
5858
- name: Run tests with coverage
5959
run: |
60-
pytest --cov --cov-report=term --cov-branch
60+
pytest --cov --cov-branch --cov-report=xml
61+
62+
- name: Upload coverage reports to Codecov
63+
uses: codecov/codecov-action@v5
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Publish to TestPyPI
22

33
on:
4+
workflow_dispatch:
45
push:
5-
branches:
6-
- main
7-
workflow_dispatch: # Manual trigger
6+
tags:
7+
- '*.*.*'
88

99
jobs:
1010
build-and-test:

.github/workflows/docs-preview.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
on:
2+
workflow_dispatch:
3+
pull_request:
4+
branches: [ main, otter ]
5+
6+
name: Preview Documentation
7+
8+
jobs:
9+
render-docs-preview-deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
deployments: write
14+
pull-requests: write
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Quarto
20+
uses: quarto-dev/quarto-actions/setup@v2
21+
22+
# Set up Python
23+
- name: Set up Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.13'
27+
28+
# Install dependencies
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -e .[docs]
33+
34+
# manually call quartodoc build
35+
- name: quartodoc build
36+
run: |
37+
quartodoc build
38+
39+
- name: Render Quarto Project
40+
uses: quarto-dev/quarto-actions/render@v2
41+
42+
# =====================================================
43+
# Deploy to Netlify
44+
# =====================================================
45+
46+
# Create a unique name for this deployment using the PR number
47+
# This helps track which PR preview is which
48+
- name: Configure release name
49+
run: echo "RELEASE_NAME=pr-${{ github.event.number }}" >> $GITHUB_ENV
50+
51+
# Create a deployment status on GitHub to track the deployment progress
52+
# This shows up in the PR's "Deployments" section
53+
- name: Create deployment status
54+
uses: bobheadxi/deployments@v1
55+
id: deployment
56+
with:
57+
step: start
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
env: ${{ env.RELEASE_NAME }}
60+
ref: ${{ github.head_ref }}
61+
logs: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
62+
63+
# Deploy the rendered site to Netlify with a PR-specific preview URL
64+
# The alias ensures each PR gets its own stable URL during review
65+
- name: Deploy to Netlify
66+
id: netlify
67+
env:
68+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
69+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
70+
run: |
71+
npm install -g netlify-cli
72+
netlify deploy --dir=_site/ --alias="pr-${{ github.event.number }}" 2>&1 | tee deploy.log
73+
DEPLOY_URL=$(grep -oP 'https://[^\s]+' deploy.log | grep -E '(netlify\.app|--.*\.netlify\.app)' | head -n 1)
74+
echo "url=${DEPLOY_URL}" >> $GITHUB_OUTPUT
75+
76+
# Update the GitHub deployment status with success/failure and the preview URL
77+
# This creates a clickable link in the PR to view the deployed preview
78+
- name: Update deployment status
79+
uses: bobheadxi/deployments@v1
80+
if: always()
81+
with:
82+
step: finish
83+
token: ${{ secrets.GITHUB_TOKEN }}
84+
status: ${{ job.status }}
85+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
86+
env: ${{ steps.deployment.outputs.env }}
87+
env_url: ${{ steps.netlify.outputs.url }}
88+
logs: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,17 @@ All notable changes to this project will be documented in this file.
5858
- Removed unused `docs` directory and Sphinx configuration
5959
- Removed unused GitHub Actions workflows
6060
- Removed Sphinx-related dependencies from `pyproject.toml`
61+
62+
## [3.0.0] - 2026-02-02
63+
64+
- Fixed errors when running examples in `README.md` and docstrings (with many thanks to the peer review)
65+
- Added step-by-step tutorials to `README.md` and documentation site (with many thanks to the peer review)
66+
- Added `CHANGELOG.md` to the documentation site
67+
- Added badges to `README.md` for PyPI version, build status, code quality, and documentation status
68+
- Added more words to `minidict` dataset
69+
- Added more in-line comments to user functions (with many thanks to the peer review)
70+
- Added work organization and retrospectives to `CONTRIBUTING.md`
71+
- Added GitHub Actions workflow for dynamic versioning
72+
- Added GitHub Actions workflow for previewing documentation site
73+
- Added GitHub Actions workflow for code coverage reporting
74+
- Removed redundant signs in the example code snippets in `README.md` (with many thanks to the peer review)

CONTRIBUTING.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,158 @@ Before you submit a pull request, check that it meets these guidelines:
111111
112112
Your suggested code should follow [PEP 8](https://pep8.org/) Python style guide. We recommend [Ruff](https://docs.astral.sh/ruff/) for automatic code formatting and linting. Use straightforward variable names and keep functions focused on one single task. Docstrings need to be documented under all functions and classes definitions using [NumPy style](https://peps.python.org/pep-0008/#documentation-strings).
113113
114+
## Development Tools and Infrastructure
115+
116+
This section documents the development tools, GitHub infrastructure, and organizational practices applied in this project, as well as considerations for scaling up similar projects.
117+
118+
### Tools Used in This Project
119+
120+
#### Package Management and Build Tools
121+
122+
- **Hatch**: Modern Python project manager for building, versioning, and environment management
123+
- Simplifies dependency management and virtual environment creation
124+
- Provides consistent build and test workflows on deploying package
125+
- **Conda**: Cross-platform package and environment manager
126+
- Manages project dependencies and isolated environments
127+
- Facilitates reproducible development setups
128+
129+
#### Code Quality and Testing
130+
131+
- **pytest**: Testing framework for writing and running unit tests
132+
- Comprehensive test coverage in `tests/` directory
133+
- Enables test-driven development practices
134+
- **Codecov**: Code coverage reporting tool
135+
- Tracks test coverage percentage
136+
- Identifies untested code paths
137+
- **Ruff**: Python linter and code formatter
138+
- Enforces code style and quality standards
139+
- Automatically formats code to adhere to PEP 8 guidelines
140+
141+
#### Documentation
142+
143+
- **Quarto**: Scientific and technical publishing system
144+
- Generates project documentation from markdown and code
145+
- Integrates narrative text with executable code examples
146+
- **quartodoc**: Quarto extension for documentation sites
147+
- Provides templates and tools for building documentation websites
148+
- **NumPy-style docstrings**: Standard documentation format
149+
- Provides clear, structured documentation for all functions
150+
- Enables automatic documentation generation
151+
152+
#### Version Control
153+
154+
- **Git**: Distributed version control system
155+
- **GitHub**: Cloud-based repository hosting and collaboration platform
156+
157+
### GitHub Infrastructure
158+
159+
Our project leverages several GitHub features for collaboration and automation:
160+
161+
#### Repository Organization
162+
163+
- **Branching Strategy**: Feature branch workflow
164+
- `main` branch for stable code
165+
- `otter` branch as our dev branch to integrate features, bug fixes, and changes before they are ready for production
166+
- `gh-pages`: Branch for hosting documentation site
167+
- Pull requests for merging changes into `main` or `otter`
168+
169+
#### Issue Tracking
170+
171+
- **GitHub Projects**: Kanban boards for task tracking
172+
- Backlog management and roadmap visualization
173+
- Allow tracking issues, pull requests, and ideas across customizable columns
174+
- **Issue Templates**: Standardized formats for bug reports and feature requests
175+
- Ensures comprehensive information collection
176+
- Streamlines triage and prioritization
177+
178+
#### Pull Request Workflow
179+
180+
- **Pull Request Templates**: Guide contributors through necessary information
181+
- **Code Review**: Copilot and peer review process before merging
182+
- **Automated Checks**: CI/CD integration validates code quality
183+
184+
#### Project Documentation
185+
186+
- **README.md**: Project overview, installation, and usage instructions
187+
- **CONTRIBUTING.md**: Contribution guidelines and development setup
188+
- **CODE_OF_CONDUCT.md**: Community standards and expectations
189+
- **CHANGELOG.md**: Record of changes and version history
190+
- **LICENSE**: MIT License for open-source distribution
191+
192+
### Organizational Practices
193+
194+
#### Development Workflow
195+
196+
- **Issue-Driven Development**: All changes start with an issue
197+
- **Test-Driven Development**: Write tests before implementing features
198+
- **Code Review**: All changes reviewed by at least one team member
199+
200+
#### Team Collaboration
201+
202+
- **Clear Ownership**: Issues assigned to specific team members
203+
- **Communication**: GitHub issues and pull requests for async collaboration
204+
- **Documentation**: Comprehensive inline comments and docstrings
205+
- **Consistency**: Shared code style and formatting standards
206+
207+
#### Quality Assurance
208+
209+
- **Type Hints**: Python type annotations throughout codebase
210+
- **Unit Tests**: Comprehensive test coverage in `tests/unit/`
211+
- **Manual Testing**: Verification of functionality before merging
212+
213+
### Scaling Up: Tools and Practices for Larger Projects
214+
215+
If scaling this or similar projects, we would implement the following additional tools and practices:
216+
217+
#### Continuous Integration/Continuous Deployment (CI/CD)
218+
219+
- **GitHub Actions**: Automate testing, building, and deployment
220+
- Run test suite on every push and pull request
221+
- Automatic package building and publishing to PyPI
222+
- Documentation deployment to GitHub Pages or Read the Docs
223+
- **Pre-commit Hooks**: Enforce code quality locally before commits
224+
- Check for large files, merge conflicts, and trailing whitespace
225+
226+
#### Enhanced Testing
227+
228+
- **Performance Tests**: Ensure functions maintain acceptable performance
229+
- **Integration Tests**: Test component interactions
230+
- **End-to-End Tests**: Validate complete workflows
231+
232+
#### Dependency Management
233+
234+
- **Dependabot**: Automated dependency updates
235+
- Security vulnerability notifications
236+
- Automatic pull requests for updates
237+
- **Safety/Bandit**: Security scanning for vulnerabilities
238+
- **Lock Files**: Pin exact dependency versions for reproducibility
239+
240+
#### Code Quality Tools
241+
242+
- **MyPy**: Static type checking
243+
- Catch type errors before runtime
244+
- Improve code reliability
245+
- **Coverage Requirements**: Enforce minimum coverage thresholds
246+
- **SonarQube/CodeClimate**: Advanced code quality metrics
247+
- Code complexity analysis
248+
- Maintainability scoring
249+
- Security hotspot detection
250+
251+
#### Project Management
252+
253+
- **Issue Automation**: Automated labeling and triage
254+
- **Release Management**: Semantic versioning with automated releases
255+
256+
#### Monitoring and Analytics
257+
258+
- **PyPI Statistics**: Track package downloads and usage
259+
- **Error Tracking**: Sentry or similar for runtime error monitoring
260+
- **User Feedback**: Issue templates for user-reported bugs and features
261+
262+
### Conclusion
263+
264+
The tools and practices applied in this project establish a solid foundation for collaborative open-source development. For larger-scale projects, the additional infrastructure focuses on automation, quality assurance, and enabling distributed teams to work effectively. The key principle is to automate routine tasks, enforce quality standards early in the development process, and maintain clear documentation and communication channels.
265+
114266
## Code of Conduct
115267
116268
Please not that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

README.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
| | |
44
|--------|--------|
5-
| Package | [![Latest PyPI Version](https://img.shields.io/pypi/v/wordguess.svg)](https://pypi.org/project/wordguess/) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/wordguess.svg)](https://pypi.org/project/wordguess/) |
6-
| Meta | [![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) |
5+
| Package | [![Latest Test PyPI Version](https://img.shields.io/pypi/v/wordguess?label=TestPyPI&logo=python&color=blue&pypiBaseUrl=https%3A%2F%2Ftest.pypi.org)](https://test.pypi.org/project/wordguess/) [![Supported Python Versions](https://img.shields.io/badge/python->=3.10-blue?logo=python)](https://test.pypi.org/project/wordguess/) |
6+
| Meta | [![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
7+
|Testing |[![Unit Tests](https://github.com/UBC-MDS/wordguess/actions/workflows/build.yml/badge.svg)](https://github.com/UBC-MDS/wordguess/actions/workflows/build.yml) [![codecov](https://codecov.io/github/UBC-MDS/wordguess/graph/badge.svg?token=wxpY8GJ0LI)](https://codecov.io/github/UBC-MDS/wordguess) |
8+
| Documentation|[![Docs Build](https://github.com/UBC-MDS/wordguess/actions/workflows/docs.yml/badge.svg)](https://github.com/UBC-MDS/wordguess/actions/workflows/docs.yml) |
79

810
Wordguess is a project that contains essential functions for a word-guessing game, inspired by [Wordle](https://www.nytimes.com/games/wordle/index.html).
911

@@ -26,22 +28,40 @@ You can install this package into your preferred Python environment using pip:
2628

2729
```bash
2830
pip install -i https://test.pypi.org/simple/ wordguess
29-
``````
31+
```
32+
33+
To use `wordguess` in your code, you can follow this full example that applies the built-in `minidict` dataset and all four main functions:
34+
35+
```python
36+
# 1. Load the package with alias.
37+
import wordguess as wg
38+
```
3039

31-
To use `wordguess` in your code:
40+
```python
41+
# 2. Get the string results of making three different guesses against the target "major".
42+
result_hist = {}
43+
for word in ['whelp','might','madam']:
44+
# As a player, we do not know the target word "major",
45+
# so we simulate getting the result:
46+
result_hist[word] = wg.get_result('major', word)
47+
```
48+
49+
```python
50+
# 3. Get the top three possible target words based on the result history.
51+
# This may be used to provide hints to the player.
52+
wg.get_n_guesses(result_hist, n=3)
53+
```
3254

3355
```python
34-
>>> from wordguess.get_result import get_result
35-
>>> get_result("spark", "spoon")
56+
# 4. Get the overall score of guesses based on the results:
57+
results = list(result_hist.values())
58+
wg.get_score(results)
3659
```
3760

3861
```python
39-
>>> import wordguess as wg
40-
>>>
41-
>>> result_hist = {}
42-
>>> for word in ['whelp','might','madam']:
43-
>>> result_hist[word] = wg.get_result('major', word)
44-
>>> wg.get_n_guesses(result_hist, n=10)
62+
# 5. Convert the result of the last guess into a human-readable pattern.
63+
last_result = result_hist['madam']
64+
wg.result_to_pattern(last_result)
4565
```
4666

4767
## Development

_quarto.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ project:
55
- LICENSE
66
- CODE_OF_CONDUCT.md
77
- CONTRIBUTING.md
8+
- CHANGELOG.md
89
- README.md
910

1011
website:
@@ -35,6 +36,8 @@ website:
3536
href: index.qmd
3637
- text: "API Reference"
3738
href: reference/index.qmd
39+
- text: "Changelog"
40+
href: CHANGELOG.md
3841
- text: "Contributing Guide"
3942
href: CONTRIBUTING.md
4043
- text: "Code of Conduct"

0 commit comments

Comments
 (0)