Skip to content

Commit

Permalink
2.0 course mods (#75)
Browse files Browse the repository at this point in the history
Changes made for the development of The Complete pytest Course
  • Loading branch information
okken committed Nov 10, 2023
1 parent 285d174 commit 468676f
Show file tree
Hide file tree
Showing 41 changed files with 375 additions and 849 deletions.
12 changes: 0 additions & 12 deletions .coveragerc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -19,5 +20,4 @@ jobs:
- name: Install Tox and any other packages
run: pip install tox
- name: Run Tox
# Run tox using the version of Python in `PATH`
run: tox -e py
44 changes: 0 additions & 44 deletions .pre-commit-config.yaml

This file was deleted.

51 changes: 24 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
.DEFAULT_GOAL := help

help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
grep '\#\#' Makefile

clean: clean-build clean-pyc clean-test clean-docs ## remove all build, test, coverage and Python artifacts
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

clean-build: ## remove build artifacts
rm -fr dist/
Expand All @@ -18,43 +18,40 @@ clean-pyc: ## remove Python file artifacts

clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache/
find . -name '.coverage' -exec rm -fr {} +
find . -name 'htmlcov' -exec rm -fr {} +
find . -name '.pytest_cache' -exec rm -fr {} +

clean-docs: ## remove mkdocs site
rm -fr site/
lint: ## check style
tox -e lint

lint: ## check style with flake8
tox -e flake8
test: ## run tests on one version of Python
tox -e py

test: ## run tests quickly with the default Python
tox: ## run tests on all available versions of Python
tox

tox: ## alias so "make tox" works
tox

docs: ## generate HTML documentation
pip install mkdocs
mkdocs build

servedocs: docs ## compile the docs watching for changes
mkdocs serve

release: clean ## package and upload a release
pip install twine
rm -fr dist
flit build
flit install
twine upload dist/*
flit publish
@echo "pushing tags"
git tag $(cards version)
git push --tags

dist: clean ## builds source and wheel package
rm -fr dist
flit build
ls -l dist

install: clean ## install the package to the active Python's site-packages
flit install --symlink
install: ## install in editable mode
pip install -e .

dev: ## create dev env
py -m venv venv --prompt cards_proj
venv/bin/pip install -U pip
venv/bin/pip install pytest tox pytest-cov coverage
venv/bin/pip install -e .
@echo "-------------------------"
@echo "dev env ready to activate"
@echo "-------------------------"


100 changes: 47 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,75 @@
cards
=====

[![image](https://img.shields.io/pypi/v/cards.svg)](https://pypi.python.org/pypi/cards)
[![image](https://github.com/okken/cards/workflows/CI/badge.svg?branch=master)](https://github.com/okken/cards/actions?workflow=CI)
[![Documentation Status](https://readthedocs.org/projects/cards-project/badge/?version=latest)](https://cards-project.readthedocs.io/en/latest/?badge=latest)
[![image](https://codecov.io/gh/okken/cards/branch/master/graph/badge.svg)](https://codecov.io/gh/okken/cards)

Project task tracking / todo list

Initial Goals of the project
A Teaching Project
----------------------------

- Create a command line application that can be used to track the
status of a multi-person project.
- Explore the problems inherent in all applications regarding
usability, testing, packaging, deployment, etc.
This project is used for teaching the concepts of software testing.
Specifically, testing with the pytest test framework.

The project appears in:
- [The Complete pytest Course](https://pythontest.com/courses/)
- uses cards version 2.0.0
- [Python Testing with pytest, 2nd edition](https://pythontest.com/pytest-book/)
- uses cards version 1.0.1 - approximately

Rough Current Status
--------------------
Can be used as a simple todo list
---------------------------------

- A \"usable\" API and CLI.
- Database location is flexible to the API, but the CLI hard codes it
to a single user home directory.
Even though the primary goal of the project is for teaching about software testing, I also use it as a simple command line task tracker for myself and my team.

Usage
-----

See [usage](https://cards-project.readthedocs.io/en/latest/usage/) page
for details, but here\'s a demo of how it works:
Here's a demo of how it works:

$ cards add a todo

$ cards add -o Brian another task

$ cards list
╷ ╷ ╷
ID │ state │ owner │ summary
╺━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━╸
1 │ todo │ │ a todo
2 │ todo │ Brian │ another task
╵ ╵ ╵

ID state owner summary
───────────────────────────────────
1 todo a todo
2 todo Brian another task

$ cards update 1 -o Brian

$ cards finish 1

$ cards finish 1
$ cards
ID │ state │ owner │ summary
╺━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━╸
1 │ done │ Brian │ a todo
2 │ todo │ Brian │ another task
╵ ╵ ╵

$ cards delete 1

$ cards
ID │ state │ owner │ summary
╺━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━╸
2 │ todo │ Brian │ another task
╵ ╵ ╵
ID state owner summary
───────────────────────────────────
1 done Brian a todo
2 todo Brian another task

$ cards --help
Usage: cards [OPTIONS] COMMAND [ARGS]...

Cards is a small command line task tracking application.
$ cards delete 1
$ cards

Options:
--help Show this message and exit.
ID state owner summary
───────────────────────────────────
2 todo Brian another task

Commands:
add Add a card to db.
config List the path to the Cards db.
count Return number of cards in db.
delete Remove card in db with given id.
finish Set a card state to 'done'.
list List cards in db.
start Set a card state to 'in prog'.
update Modify a card in db with given id with new info.
version Return version of cards application
$ cards --help

Usage: cards [OPTIONS] COMMAND [ARGS]...

Cards is a small command line task tracking application.

╭─ Options ────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────╮
│ add Add a card to db. │
│ config List the path to the Cards db. │
│ count Return number of cards in db. │
│ delete Remove card in db with given id. │
│ finish Set a card state to 'done'. │
│ list List cards in db. │
│ start Set a card state to 'in prog'. │
│ update Modify a card in db with given id with new info. │
│ version Return version of cards application │
╰──────────────────────────────────────────────────────────────────╯
36 changes: 0 additions & 36 deletions docs/TODO.md

This file was deleted.

0 comments on commit 468676f

Please sign in to comment.