Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp #30

Merged
merged 6 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]
defaults:
run:
shell: bash
Expand Down
28 changes: 13 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -15,10 +13,11 @@ repos:
- id: check-json
- id: debug-statements
- id: end-of-file-fixer
exclude_types: [svg]
- id: forbid-new-submodules
- id: mixed-line-ending
- id: trailing-whitespace
exclude_types: [svg]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
Expand All @@ -27,22 +26,21 @@ repos:
- id: python-no-log-warn
- id: python-use-type-annotations
- id: python-check-blanket-type-ignore

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.2
rev: 0.28.5
hooks:
- id: check-github-workflows
- id: check-github-actions
- id: check-dependabot
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.5
hooks:
- id: pycln
args: [--config=pyproject.toml]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.4.10'
hooks:
- id: isort
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black
8 changes: 7 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
### Added

- [#3](https://github.com/JoshKarpel/synthesize/pull/3) Added PyPI classifiers and other metadata.
- [#4](https://github.com/JoshKarpel/synthesize/pull/4) Switch to Parsy (from Lark) for parsing `synthfile`s and hit 100% coverage of the underlying format.

### Changed

- [#30](https://github.com/JoshKarpel/synthesize/pull/30)
Reorganized configuration to separate targets,
triggers (formerly "lifecycles"),
and flows (graphs of targets and triggers)."

## `0.0.2`

Expand Down
29 changes: 0 additions & 29 deletions examples/dag.synth

This file was deleted.

61 changes: 30 additions & 31 deletions examples/dag.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
flows:
dag:
nodes:
- id: 1
target:
id: sleep-and-echo
- id: 2
target:
id: sleep-and-echo
- id: 3
target:
id: sleep-and-echo
- id: 4
target:
id: sleep-and-echo
trigger:
after: ["1", "2"]
- id: 5
target:
id: sleep-and-echo
trigger:
after: ["3"]
- id: 6
target:
id: sleep-and-echo
trigger:
after: ["4", "5"]

targets:
- id: 1
sleep-and-echo:
commands: |
sleep 2
echo 1
- id: 2
commands: |
sleep 2
echo 2
- id: 3
commands: |
sleep 2
echo 3
- id: 4
commands: |
sleep 2
echo 4
after:
- 1
- 2
- id: 5
commands: |
sleep 2
echo 5
after:
- 2
- 3
- id: 6
commands: |
sleep 2
echo 6
after:
- 4
- 5
echo "Hi!"
3 changes: 0 additions & 3 deletions examples/hello.synth

This file was deleted.

16 changes: 0 additions & 16 deletions examples/meta.synth

This file was deleted.

1,594 changes: 881 additions & 713 deletions poetry.lock

Large diffs are not rendered by default.

42 changes: 31 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@ include = ["py.typed"]

[tool.poetry.dependencies]
python = ">=3.10"
pydantic = ">=1.10"
pydantic = ">=2"
rich = ">=13.3"
typer = ">=0.7"
click = ">=8.1"
pyyaml = ">=6.0"
networkx = ">=3.0"
watchfiles = ">=0.18"
identify = ">=2.5"
parsy = ">=2"

[tool.poetry.group.dev.dependencies]
pre-commit = ">=3"
pytest = ">=7"
pytest-cov = ">=3"
pytest-xdist = ">=3"
pytest-asyncio = ">=0.20"
pytest-mock = ">=3"
hypothesis = ">=6"
Expand All @@ -62,15 +60,8 @@ synth = 'synthesize.cli:cli'
line-length = 100
include = "\\.pyi?$"

[tool.isort]
profile = "black"
line_length = 100

[tool.pycln]
all = true

[tool.pytest.ini_options]
addopts = ["--strict-markers", "-n", "4", "-v"]
addopts = ["--strict-markers", "-v"]
testpaths = ["tests", "synthesize", "docs"]

markers = ["slow"]
Expand All @@ -96,3 +87,32 @@ warn_unreachable = true
warn_redundant_casts = true

ignore_missing_imports = true


[tool.ruff]
line-length = 120

[tool.ruff.lint]
select = [
"I", # https://beta.ruff.rs/docs/rules/#isort-i
"F", # https://beta.ruff.rs/docs/rules/#pyflakes-f
"E", # https://beta.ruff.rs/docs/rules/#error-e
"W", # https://beta.ruff.rs/docs/rules/#warning-w
"T20", # https://beta.ruff.rs/docs/rules/#flake8-print-t20
"PIE", # https://beta.ruff.rs/docs/rules/#flake8-pie-pie
"PLC", # https://beta.ruff.rs/docs/rules/#convention-plc
"PLE", # https://beta.ruff.rs/docs/rules/#error-ple
"PLW", # https://beta.ruff.rs/docs/rules/#warning-plw
"PTH", # https://beta.ruff.rs/docs/rules/#flake8-use-pathlib-pth
"PGH", # https://beta.ruff.rs/docs/rules/#pygrep-hooks-pgh
"RUF", # https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf
]

ignore = [
"E501", # line length exceeds limit
"E741", # ambiguous variable name
"T201", # print
"T203", # pprint
"F403", # star imports, used for utilities
"F405", # star imports, used for utilities
]
39 changes: 39 additions & 0 deletions synth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
flows:
default:
nodes:
- id: tests
target:
id: tests
trigger:
id: code-changes
- id: types
target:
id: types
trigger:
id: code-changes
- id: docs
target:
id: docs
trigger:
type: restart

targets:
tests:
commands: |
pytest --cov

types:
commands: |
mypy

docs:
commands: |
mkdocs serve --strict

triggers:
code-changes:
type: watch
paths:
- synthesize/
- tests/
- examples/
Loading
Loading