Skip to content

Commit

Permalink
Normalize more (windows) paths (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Dec 21, 2023
1 parent 98a38cd commit 73a2db1
Show file tree
Hide file tree
Showing 26 changed files with 185 additions and 98 deletions.
6 changes: 2 additions & 4 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ dependencies:
- twine
# publish deps
# lint deps
- black
- mypy
- nbqa
- nbstripout
- nodejs >=18,<19
- nodejs >=20,<21
- ruff
- ssort
- taplo
Expand All @@ -49,8 +48,7 @@ dependencies:
# demo deps
- ipylab
- ipywidgets >=8
- jupyterlab >=3.6.3,<4
- jupyterlab-markup
- jupyterlab >=4,<5
# demo deps
# docs deps
- docutils >=0.19
Expand Down
1 change: 0 additions & 1 deletion .github/reqs/build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ jsonschema-gentypes
ssort
ruff
mypy
black
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
outputs:
wheel: ${{ steps.wheel.outputs.wheel }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# configure builtin providers
- name: setup (python)
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand All @@ -61,7 +61,7 @@ jobs:
run: doit bootstrap

- name: lint
run: doit -n8 lint:py:ruff lint:py:black
run: doit -n8 lint:py:ruff

- name: list
run: doit list --all --status
Expand All @@ -74,7 +74,7 @@ jobs:
if: always()

- name: upload (dist)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: doitoml-dist-${{ github.run_number }}
path: ./dist
Expand All @@ -94,10 +94,10 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: install (conda)
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: .binder/environment.yml
miniforge-variant: Mambaforge
Expand Down Expand Up @@ -142,10 +142,10 @@ jobs:
git config --global core.autocrlf false
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: install (conda)
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: .github/environment.yml
miniforge-variant: Mambaforge
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:

- name: upload (reports)
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: |-
doitoml-test-${{ matrix.os }}-${{matrix.python-version }}-${{ github.run_number }}
Expand All @@ -207,13 +207,13 @@ jobs:
python-version: ["3.11"]
steps:
- name: download (dist)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: doitoml-dist-${{ github.run_number }}
path: ./dist

- name: setup (python)
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ dist/
untitled*
Untitled*
.jupyterlite*
node_modules/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 0.2.1 (unreleased)

- [#15] normalizes path drive letters on windows

[#15]: https://github.com/deathbeds/doitoml/issues/15

## 0.2.0

### Data Model
Expand Down
3 changes: 1 addition & 2 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ dependencies:
# demo deps
- ipylab
- ipywidgets >=8
- jupyterlab >=3.6.3,<4
- jupyterlab-markup
- jupyterlab >=4,<5
# demo deps
# docs deps
- docutils >=0.19
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A common use case is to create a number of tasks, changing only certain key valu
```toml
# pyproject.toml
[tool.doitoml.templates.json-e.tasks.echo]
"$map": ["a", "b"]
"$map" = ["a", "b"]

[tool.doitoml.templates.json-e.tasks.echo."each(x)"]
name = "${x}"
Expand Down
12 changes: 7 additions & 5 deletions docs/how-to/user-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ the box.
```toml
[tool.doitoml.tasks.copy]
actions = [
{py = {"shutil:copytree" = {kwargs = {src = "from/path/", dst = "to/path"} } }
{py = {"shutil:copytree" = {kwargs = {src = "from/path/", dst = "to/path"} } } }
]
```
~~~
Expand Down Expand Up @@ -113,7 +113,7 @@ Can be referenced as:
# pyproject.toml
[tool.doitoml.tasks.greet]
actions = [
{py = {"my_actions:greet" = {args = ["hello", "world"] } }
{py = {"my_actions:greet" = {args = ["hello", "world"] } } }
]
```

Expand Down Expand Up @@ -141,7 +141,7 @@ The `pyproject.toml` in the `child` directory can extend `sys.path` to find the
# child/pyproject.toml
[tool.doitoml.tasks.greet]
actions = [
{py = {"../my_actions:greetings:greet" = {args = ["hello", "world"] } }
{py = {"../my_actions:greetings:greet" = {args = ["hello", "world"] } } }
]
```

Expand All @@ -153,10 +153,12 @@ imported...
```toml
# pyproject.toml
[tool.doitoml.tasks.greet]
actions=[{ py = {"dodo:greet": { kwargs = { whom = "world" } } } }]
actions = [
{ py = {"dodo:greet" = { kwargs = { whom = "world" } } } }
]

[tool.doitoml.tasks.greet]
actions=[{ py = {"dodo:dump": { } } }]
actions = [{ py = {"dodo:dump" = { } } }]
```

... and even explore a `DoiTOML` instance.
Expand Down
4 changes: 2 additions & 2 deletions docs/understanding/doit-good.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ formatters, with as aggressive-as-possible options. A `doit format` task that au
as much as possible will not only improve the _stability_ and _responsiveness_ of a
`doit` task tree, but also lead to cleaner revision control history.

For example, on `doitoml`'s own Python code, `ssort`, `black`, and `ruff` are all used
to take as much guesswork as possible out of line- and token-level syntax choices.
For example, on `doitoml`'s own Python code, `ssort` and `ruff` are used to take as much
guesswork as possible out of line- and token-level syntax choices.

## Single sources of truth

Expand Down
25 changes: 25 additions & 0 deletions examples/py-js-web/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
enableImmutableInstalls: false
enableInlineBuilds: false
enableTelemetry: false
httpTimeout: 60000
nodeLinker: node-modules
npmRegistryServer: https://registry.npmjs.org/
installStatePath: ./build/.cache/yarn/install-state.gz
globalFolder: ./build/.cache/yarn
cacheFolder: ./build/.cache/yarn
# these messages provide no actionable information, and make non-TTY output
# almost unreadable, masking real dependency-related information
# see: https://yarnpkg.com/advanced/error-codes
logFilters:
- code: YN0006 # SOFT_LINK_BUILD
level: discard
- code: YN0007 # MUST_BUILD
level: discard
- code: YN0008 # MUST_REBUILD
level: discard
- code: YN0013 # FETCH_NOT_CACHED
level: discard
- code: YN0019 # UNUSED_CACHE_ENTRY
level: discard
- code: YN0002 # BOO_PEER_DEPS_LIKE_REACT
level: discard
2 changes: 1 addition & 1 deletion examples/py-js-web/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
dependencies:
# runtimes
- python >=3.11,<3.12
- nodejs >=18,<19
- nodejs >=20,<21
# run
- fastapi
- uvicorn-standard
Expand Down
3 changes: 2 additions & 1 deletion examples/py-js-web/js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"target": "es2018",
"strict": true,
"sourceMap": true,
"tsBuildInfoFile": "../build/tsconfig.tsbuildinfo"
"tsBuildInfoFile": "../build/tsconfig.tsbuildinfo",
"moduleResolution": "nodenext"
},
"include": ["./**/*.ts"]
}
8 changes: 6 additions & 2 deletions examples/py-js-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
"y_lock": [
"yarn.lock"
],
"y_rc": [
".yarnrc.yml"
],
"y_install_state": [
".yarn/install-state.gz"
"build/.cache/yarn/install-state.gz"
],
"w_cfg": [
"webpack.config.js"
Expand Down Expand Up @@ -71,7 +74,8 @@
],
"file_dep": [
"::backend::venv_history",
"::pj"
"::pj",
"::y_rc"
],
"targets": [
"::y_install_state",
Expand Down
8 changes: 4 additions & 4 deletions examples/py-js-web/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ license = ["./LICENSE"]
ppt = ["./pyproject.toml"]
py_src = [":rglob::src::*.py"]
readme = ["./README.md"]
sdist = ["dist/example-web-${EXAMPLE_PY_VERSION}.tar.gz"]
sdist = ["dist/example_web-${EXAMPLE_PY_VERSION}.tar.gz"]
venv = ["./.venv"]
venv_history = ["./.venv/conda-meta/history"]
whl = ["dist/example_web-${EXAMPLE_PY_VERSION}-py3-none-any.whl"]
Expand Down Expand Up @@ -104,8 +104,8 @@ file_dep = ["::all_dist"]
targets = ["::dist_hash"]

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

[tool.__doitoml_tests__.steps.01_run.after.files]
"*" = 12
"*" = 11
"yarn.lock" = 1
"dist/*.tar.gz" = 1
"dist/*.whl" = 1
Expand Down
25 changes: 25 additions & 0 deletions js/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
enableImmutableInstalls: false
enableInlineBuilds: false
enableTelemetry: false
httpTimeout: 60000
nodeLinker: node-modules
npmRegistryServer: https://registry.npmjs.org/
installStatePath: ../build/.cache/yarn/install-state.gz
globalFolder: ../build/.cache/yarn
cacheFolder: ../build/.cache/yarn
# these messages provide no actionable information, and make non-TTY output
# almost unreadable, masking real dependency-related information
# see: https://yarnpkg.com/advanced/error-codes
logFilters:
- code: YN0006 # SOFT_LINK_BUILD
level: discard
- code: YN0007 # MUST_BUILD
level: discard
- code: YN0008 # MUST_REBUILD
level: discard
- code: YN0013 # FETCH_NOT_CACHED
level: discard
- code: YN0019 # UNUSED_CACHE_ENTRY
level: discard
- code: YN0002 # BOO_PEER_DEPS_LIKE_REACT
level: discard
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
":glob::.::yarn.lock"
],
"yarn_out": [
".yarn/install-state.gz"
"../build/.cache/yarn/install-state.gz"
],
"prettier_ignore": [
".prettierignore"
Expand Down
Loading

0 comments on commit 73a2db1

Please sign in to comment.