Skip to content

Commit

Permalink
begin migration to GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hbmartin committed Jul 1, 2024
1 parent 7519935 commit 6e1fe2b
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
34 changes: 34 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint and Test
on: push

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: cpython3
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: requirements.txt
- run: pip install -r requirements.txt
- run: pip install black ruff pytype pytest
# - run: ruff check .
- name: Run pytype if not on 3.12
run: |
if [[ '${{ steps.cpython3.outputs.python-version }}' == *"3.12"* ]]; then
echo "pytype does not support 3.12: https://github.com/google/pytype/issues/1475"
else
pytype -j auto podcast_transcript_tools
fi
- uses: psf/black@stable
with:
options: "--check --verbose"
- run: pytest
5 changes: 4 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"setup.py",
"site-packages",
"venv",
]

# Same as Black.
line-length = 88
indent-width = 4

lint.select = ["ALL"]
target-version = "py312"

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ANN201", "E501", "PLR2004", "PT011", "S101"]

[tool.pytest.ini_options]
pythonpath = ". venv/lib/python3.12/site-packages"
testpaths = "test"
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pygraphviz==1.13
svg.path==4.1
4 changes: 2 additions & 2 deletions test/test_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def check_edge_dir(e, dx, dy):


def test_hello():
file = "./directed/hello.gv.txt"
file = "test/directed/hello.gv.txt"
xml = graphviz2drawio.convert(file)
print(xml)

Expand All @@ -63,7 +63,7 @@ def test_hello():


def test_polylines():
file = "./undirected/polylines.gv.txt"
file = "test/undirected/polylines.gv.txt"
xml = graphviz2drawio.convert(file)
print(xml)

Expand Down

0 comments on commit 6e1fe2b

Please sign in to comment.