Skip to content

Commit

Permalink
Postmortem for 0.1.0 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl authored May 2, 2023
1 parent 54e7aec commit 7144cc0
Show file tree
Hide file tree
Showing 19 changed files with 268 additions and 1,625 deletions.
43 changes: 41 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
matrix:
os: [ubuntu]
python-version: ["3.11"]
outputs:
wheel: ${{ steps.wheel.outputs.wheel }}
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -71,11 +73,15 @@ jobs:
run: doit list --all --status | sort
if: always()

- name: Upload (dist)
- name: upload (dist)
uses: actions/upload-artifact@v3
with:
name: doitoml-dist-${{ github.run_number }}
path: ./dist
- id: wheel
name: get wheel name
run: |
echo "wheel=$(ls dist/*.whl)" >> $GITHUB_OUTPUT
docs:
name: docs
Expand Down Expand Up @@ -129,7 +135,7 @@ jobs:
os: ["ubuntu", "macos", "windows"]
python-version: ["3.8", "3.11"]
env:
SKIP_CODEGEN: 1
DOITOML_SKIP_CODEGEN: 1
steps:
- name: configure line endings
run: |
Expand Down Expand Up @@ -188,3 +194,36 @@ jobs:
- name: Rename uncached conda packages
shell: bash
run: mv "${CONDA_PKGS_DIR}" "${CONDA_PKGS_DIR}_do_not_cache"

smoke:
runs-on: ${{ matrix.os }}-latest
needs: [build]
name: smoke (${{ matrix.os }} ${{ matrix.python-version }})
strategy:
max-parallel: 2
fail-fast: false
matrix:
os: ["ubuntu", "macos", "windows"]
python-version: ["3.11"]
steps:
- name: download (dist)
uses: actions/download-artifact@v3
with:
name: doitoml-dist-${{ github.run_number }}
path: ./dist

- name: setup (python)
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: install dist
run: |
ls "${{ needs.build.outputs.wheel }}" || dir "${{ needs.build.outputs.wheel }}"
pip install -vv "${{ needs.build.outputs.wheel }}"
pip check
- name: cli smoke test
run: |
python -c "__import__('doitoml')"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.1

- fix schema import

## 0.1.0

- initial release
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,51 @@

> Load declarative tasks for [doit] from TOML, JSON, YAML, and other files.
| docs | install | build |
| :-------------------------: | :----------------------------------------------------------------------------------------: | :----------------------------------: |
| [![docs][docs-badge]][docs] | [![install from pypi][pypi-badge]][pypi] [![install from conda-forge][conda-badge]][conda] | [![build][workflow-badge]][workflow] |

> See the [full documentation][docs] for more information.
## Install

> > **TBD** for now, see the [contributing guide] for a development install.
>
> | `pip` | `conda` (or `mamba`, `micromamba`) |
> | :-------------------: | :------------------------------------: |
> | `pip install doitoml` | `conda install -c conda-forge doitoml` |
| `pip` | `conda` (or `mamba`, `micromamba`) |
| :-------------------: | :------------------------------------: |
| `pip install doitoml` | `conda install -c conda-forge doitoml` |

## Features

- **declarative** automation in a **single** `pyproject.toml`, or...
- well-known configuration paths like `package.json`
- any number of namespaced TOML, JSON, or YAML files
- other well-known configuration paths like `package.json`
- any number of namespaced TOML, JSON, [YAML](#extras) files
- from any key inside them
- augment and simplify existing `dodo.py` workflows
- reuse and transform **paths** and shell tokens
- use **globs** and transforms to capture relationships between transformed files
- flexibly configure **environment** variables
- use **templates** like Jinja2 and JSON-e for advanced use cases
- user-defined Python-based **actions** and **up-to-date** checkers
- control the **working directory** and **log paths** of processes and actions
- use [**templates**](#extras) like Jinja2 and JSON-e for advanced use cases
- **extensibility** in any part of the task definition process
- all core functionality implemented as `entry_point`-based **plugins**

### Extras

These features require additional `pip` or `conda` packages

| `pip` | `conda` | feature |
| --------------------: | ------------------------- | ------------------------------ |
| `doitoml[all]` | `doitoml-with-all` | all optional features |
| `doitoml[jinja2]` | `doitoml-with-jinja2` | Jinja2 task templates |
| `doitoml[json-e]` | `doitoml-with-json-e` | JSON-e task templates |
| `doitoml[jsonschema]` | `doitoml-with-jsonschema` | extra configuration validation |
| `doitoml[yaml]` | `doitoml-with-yaml` | YAML-based task sources |

## Usage

`doitoml` provides no additional command line abilities, and is meant to drop in to the
existing `doit` CLI.
existing [`doit run`](https://pydoit.org/cmd-run.html) CLI and
[other commands](https://pydoit.org/cmd-other.html).

### A Simple Example

Expand Down Expand Up @@ -97,3 +114,12 @@ do everything _The Hard Way_:
[docs]: https://doitoml.rtfd.io
[doit]: https://github.com/pydoit/doit
[github]: https://github.com/deathbeds/doitoml
[docs-badge]: https://readthedocs.org/projects/doitoml/badge/?version=latest
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/doitoml
[conda]: https://anaconda.org/conda-forge/doitoml
[pypi-badge]: https://img.shields.io/pypi/v/doitoml
[pypi]: https://pypi.org/project/doitoml
[workflow-badge]:
https://github.com/deathbeds/doitoml/actions/workflows/ci.yml/badge.svg?branch=main
[workflow]:
https://github.com/deathbeds/doitoml/actions/workflows/ci.yml?query=branch%3Amain
3 changes: 3 additions & 0 deletions docs/_static/img/anvil.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ def transform_add_class(self: Any, schema: Any) -> Tuple[Any, Any]:
"url": PROJ_DATA["project"]["urls"]["PyPI"],
"icon": "fa-brands fa-python",
},
{
"name": "conda-forge",
"url": "https://github.com/conda-forge/doitoml-feedstock#about-doitoml",
"icon": "_static/img/anvil.svg",
"type": "local",
},
],
"footer_end": ["mermaid10"],
}
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

```{eval-rst}
.. currentmodule:: doitoml
.. automodule:: doitoml.schema
.. automodule:: doitoml.schema.validator
```

### Schema Types
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/schema.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Schema

```{eval-rst}
.. jsonschema:: doitoml.schema.DOITOML_SCHEMA
.. jsonschema:: doitoml.schema.validator.DOITOML_SCHEMA
```
2 changes: 2 additions & 0 deletions examples/py-js-web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ dist
lib
node_modules
static
# a real project _would_ check this ins
yarn.lock
2 changes: 1 addition & 1 deletion examples/py-js-web/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
# build
- flit
- python-build
- yarn >=3,<4
- yarn ==3.5
# test
- pytest-cov
- pytest-html
Expand Down
8 changes: 5 additions & 3 deletions examples/py-js-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"doitoml": {
"env": {
"EXAMPLE_JS_VERSION": ":get::json::package.json::version",
"EXAMPLE_JS_DIST": "deathbeds-example-frontend-${EXAMPLE_JS_VERSION}.tgz"
"EXAMPLE_JS_DIST": "deathbeds-example-frontend-${EXAMPLE_JS_VERSION}.tgz",
"YARN_ENABLE_IMMUTABLE_INSTALLS": "false"
},
"prefix": "frontend",
"paths": {
Expand Down Expand Up @@ -70,10 +71,11 @@
],
"file_dep": [
"::backend::venv_history",
"::y_lock"
"::pj"
],
"targets": [
"::y_install_state"
"::y_install_state",
"::y_lock"
],
"actions": [
[
Expand Down
5 changes: 3 additions & 2 deletions examples/py-js-web/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ file_dep = ["::all_dist"]
targets = ["::dist_hash"]

[tool.__doitoml_tests__.steps.00_list]
after = {files = {"*" = 10}}
before = {files = {"**/*" = 17, "*" = 10}}
after = {files = {"*" = 9}}
before = {files = {"**/*" = 16, "*" = 9}}
rc = 0
run = ["doit", "list"]
tasks = 10
Expand All @@ -117,6 +117,7 @@ run = ["doit"]

[tool.__doitoml_tests__.steps.01_run.after.files]
"*" = 12
"yarn.lock" = 1
"dist/*.tar.gz" = 1
"dist/*.whl" = 1
"dist/SHA256SUMS" = 1
Loading

0 comments on commit 7144cc0

Please sign in to comment.