Skip to content

Commit

Permalink
Merge pull request #41 from numbworks/v4.0.0
Browse files Browse the repository at this point in the history
v4.0.0
  • Loading branch information
numbworks authored Dec 8, 2024
2 parents c3d0c32 + 8f86a25 commit e997343
Show file tree
Hide file tree
Showing 11 changed files with 4,753 additions and 2,618 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ RUN pip install pandas==2.2.3
RUN pip install requests==2.32.3
RUN pip install tabulate==0.9.0
RUN pip install 'git+https://github.com/numbworks/[email protected]#egg=nwshared&subdirectory=src'
RUN pip install 'git+https://github.com/numbworks/[email protected]#egg=nwpackageversions&subdirectory=src'

# JUPYTER NOTEBOOK
RUN pip install ipykernel==6.29.5
RUN pip install jupyter==1.1.0
RUN pip install 'git+https://github.com/numbworks/[email protected]#egg=nwpackageversions&subdirectory=src'

# UNIT TESTING
RUN pip install coverage==7.6.4
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v4.0.0 - BREAKING CHANGES
- Application:
- Feature: re-structured the whole architecture to simplify usage and future expansions.
- Maintenance: makefile now supports "*tests.py" in "type*"" targets and "tryinstall-concise" in "all-concise".
- Documentation:
- Feature: updated to v4.0.0.

v3.9.0
- Library:
- Feature: makefile added.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Contact: [email protected]

From the documentation:

> nwtimetracking is a Jupyter Notebook designed to analyze the Excel file I use to annotate the durations of all my sessions of extra work and continuos learning, so that I can run analyses on them. This software is born to overcome the lack of support for durations (timedeltas) in Excel.
> `nwtimetracking` is an application designed to run automated data analysis tasks on `Time Tracking.xlsx`. This file is the one I use to annotate the durations of all my sessions of extra work and continuos learning. This application is born to overcome the lack of support for durations (timedeltas) in Excel.
## Getting started

Expand Down
2 changes: 1 addition & 1 deletion codecoverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion codecoverage.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://img.shields.io/badge/coverage-93.0%25-green
https://img.shields.io/badge/coverage-94.0%25-green
16 changes: 10 additions & 6 deletions docs/docs-nwtimetracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ Contact: [email protected]
| 2024-10-01 | numbworks | Updated to v3.7.0. |
| 2024-10-28 | numbworks | Updated to v3.8.0. |
| 2024-12-01 | numbworks | Updated to v3.9.0. |
| 2024-12-05 | numbworks | Updated to v4.0.0. |

## Introduction

`nwtimetracking` is a `Jupyter Notebook` designed to analyze the Excel file I use to annotate the durations of all my sessions of extra work and continuos learning, so that I can run analyses on them.
`nwtimetracking` is an application designed to run automated data analysis tasks on `Time Tracking.xlsx`.

This software is born to overcome the lack of support for durations (timedeltas) in Excel.
This file is the one I use to annotate the durations of all my sessions of extra work and continuos learning. This application is born to overcome the lack of support for durations (timedeltas) in Excel.

This project may not be useful for many (not generic enough), but I decided to upload it to `Github` anyway, in order to showcase my way of working when I face similar data analysis tasks and I decide to tackle them with `Python` and `Jupyter Notebook`.

Expand Down Expand Up @@ -138,21 +139,23 @@ The avalaible target names are:
|---|---|
| type-verbose | Runs a type verification task and logs everything. |
| coverage-verbose | Runs a unit test coverage calculation task and logs the % per class. |
| tryinstall-verbose | Simulates a "pip install" and logs everything. |
| all-concise | Runs a batch of verification tasks and logs one summary line for each of them. |
The expected outcome for `all-concise` is:
```
MODULE_NAME: nwtimetracking
MODULE_VERSION: 3.9.0
MODULE_VERSION: 4.0.0
COVERAGE_THRESHOLD: 70%
[WARNING] type-concise: not passed! '1' error(s) found!
[WARNING] changelog-concise: 'CHANGELOG' not updated to current version!
[OK] type-concise: passed!
[OK] changelog-concise: 'CHANGELOG' updated to current version!
[OK] setup-concise: 'setup.py' updated to current version!
[OK] coverage-concise: unit test coverage >= 70%.
[OK] tryinstall-concise: installation process works.
```
Considering the old-fashioned syntax adopted by `make`, here a summary of its less intuitive aspects:
Considering the old-fashioned syntax adopted by both `make` and `bash`, here a summary of its less intuitive aspects:
| Aspect | Description |
|---|---|
Expand All @@ -161,6 +164,7 @@ Considering the old-fashioned syntax adopted by `make`, here a summary of its le
| `@` | By default, `make` logs all the commands included in the target. The `@` disables this behaviour. |
| `$$` | Necessary to escape `$`. |
| `$@` | Variable that stores the target name. |
| `if [[ ... ]]` | Double square brackets to enable pattern matching. |
## Known Issues - nwshared
Expand Down
31 changes: 27 additions & 4 deletions scripts/makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SETTINGS
.PHONY: clear makefile-info type-concise changelog-concise setup-concise coverage-concise all-concise
.PHONY: clear makefile-info type-concise changelog-concise setup-concise coverage-concise tryinstall-concise all-concise
SHELL := /bin/bash
ROOT_DIR := $(shell cd .. && pwd)
MODULE_NAME = "nwtimetracking"
MODULE_VERSION = "3.9.0"
MODULE_VERSION = "4.0.0"
COVERAGE_THRESHOLD = 70

# TARGETS
Expand All @@ -16,7 +16,8 @@ makefile-info:

type-verbose:
@clear; \
mypy $(ROOT_DIR)/src/$(MODULE_NAME).py --check-untyped-defs --disable-error-code=import-untyped;
mypy $(ROOT_DIR)/src/$(MODULE_NAME).py --check-untyped-defs --disable-error-code=import-untyped; \
mypy $(ROOT_DIR)/tests/$(MODULE_NAME)tests.py --check-untyped-defs --disable-error-code=import-untyped --disable-error-code=import-not-found;
coverage-verbose:
@clear; \
cd $(ROOT_DIR)/tests/; \
Expand All @@ -25,9 +26,27 @@ coverage-verbose:
coverage html --omit=$(MODULE_NAME)tests.py && sed -n '/<table class="index" data-sortable>/,/<\/table>/p' htmlcov/class_index.html | pandoc --from html --to plain; \
sleep 3; \
rm -rf htmlcov;
tryinstall-verbose:
@clear; \
cd /home; \
rm -rf build; \
rm -rf dist; \
rm -rf $(MODULE_NAME).egg-info; \
rm -rf venv; \
python /workspaces/$(MODULE_NAME)/src/setup.py bdist_wheel; \
python3 -m venv venv; \
source venv/bin/activate; \
pip install dist/$(MODULE_NAME)*.whl; \
pip show $(MODULE_NAME) | grep Version; \
deactivate; \
rm -rf build; \
rm -rf dist; \
rm -rf $(MODULE_NAME).egg-info; \
rm -rf venv;

type-concise:
@value=$$(mypy $(ROOT_DIR)/src/$(MODULE_NAME).py --disable-error-code=import-untyped | grep -c "error:"); \
value+=$$(mypy $(ROOT_DIR)/tests/$(MODULE_NAME)tests.py --disable-error-code=import-untyped --disable-error-code=import-not-found | grep -c "error:"); \
if [ $$value -eq 0 ]; then echo "[OK] $@: passed!"; else echo "[WARNING] $@: not passed! '$$value' error(s) found!"; fi;
changelog-concise:
@value=$$(cat $(ROOT_DIR)/CHANGELOG | grep -c -e "v$(MODULE_VERSION)$$" -e "v$(MODULE_VERSION) - BREAKING CHANGES$$"); \
Expand All @@ -40,6 +59,10 @@ coverage-concise:
coverage run -m unittest $(MODULE_NAME)tests.py > /dev/null 2>&1; \
value=$$(coverage report --omit=$(MODULE_NAME)tests.py | grep -oP 'TOTAL\s+\d+\s+\d+\s+\K\d+(?=%)'); \
if [ $$value -ge $(COVERAGE_THRESHOLD) ]; then echo "[OK] $@: unit test coverage >= $(COVERAGE_THRESHOLD)%."; else echo "[WARNING] $@: unit test coverage < $(COVERAGE_THRESHOLD)%."; fi;
tryinstall-concise:
@value=$$(make tryinstall-verbose 2>&1); \
last_chars=$$(echo "$$value" | tail -c 100); \
if [[ "$$last_chars" == *"Version: $(MODULE_VERSION)"* ]]; then echo "[OK] $@: installation process works."; else echo "[WARNING] $@: installation process fails!"; fi;

# AGGREGATE TARGETS
all-concise: clear makefile-info type-concise changelog-concise setup-concise coverage-concise
all-concise: clear makefile-info type-concise changelog-concise setup-concise coverage-concise tryinstall-concise
Loading

0 comments on commit e997343

Please sign in to comment.