Skip to content

Commit

Permalink
⬆️🧰 Update action run definition, dependencies and .pre-commit-config…
Browse files Browse the repository at this point in the history
….yaml (#436)

This updates the action run definition from node 16 to node 20 to get rid of the deprecation warning.
And updates all dependencies and the .pre-commit-config.yaml.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
s-weigand and dependabot[bot] authored May 17, 2024
1 parent 74fc5b1 commit 6beb34d
Show file tree
Hide file tree
Showing 11 changed files with 4,548 additions and 8,228 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

22 changes: 13 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Create fake release file for actionlint
run: |
mkdir dist
touch dist/index.js
- name: Run pre-commit
uses: pre-commit/action@v3.0.1

Expand All @@ -36,7 +40,7 @@ jobs:
run: npm test
- name: Build dist
run: npm run package
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-built
path: dist/index.js
Expand All @@ -57,7 +61,7 @@ jobs:
python --version
python integrationtests/prepare_tests.py
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down Expand Up @@ -96,7 +100,7 @@ jobs:
python --version
python integrationtests/prepare_tests.py
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down Expand Up @@ -139,7 +143,7 @@ jobs:
python --version
python integrationtests/prepare_tests.py
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down Expand Up @@ -182,7 +186,7 @@ jobs:
python --version
python integrationtests/prepare_tests.py
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down Expand Up @@ -220,7 +224,7 @@ jobs:
python --version
python integrationtests/prepare_tests.py
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down Expand Up @@ -258,7 +262,7 @@ jobs:
python --version
python integrationtests/prepare_tests.py
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down Expand Up @@ -290,7 +294,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down Expand Up @@ -333,7 +337,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download built dist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist-built
path: dist
Expand Down
60 changes: 33 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
# FORMATTER #
###################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -15,58 +15,64 @@ repos:
- id: fix-encoding-pragma
args: [--remove]

- repo: https://github.com/asottile/pyupgrade
rev: v3.8.0
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/python/black
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0 # Use the sha or tag you want to point at
rev: v3.1.0
hooks:
- id: prettier
exclude: '.all-contributorsrc'

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]

###################
# LINTER #
###################

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.277
rev: v0.4.4
hooks:
- id: ruff
name: 'ruff sort imports'
args:
- '--fix'
- '--select=I'
alias: isort
- id: ruff-format
# Commands above are both formatters an not linters
# See also: https://github.com/astral-sh/ruff/discussions/7310#discussioncomment-7102010
- id: ruff
name: 'ruff lint'

- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v8.44.0' # Use the sha / tag you want to point at
rev: 'v8.56.0' # Use the sha / tag you want to point at
hooks:
- id: eslint
files: \.ts$
types: [file]
additional_dependencies:
- eslint@8.44.0
- '@typescript-eslint/eslint-plugin@6.1.0'
- '@typescript-eslint/parser@6.1.0'
- 'eslint-config-prettier@8.8.0'
- 'eslint-plugin-prettier@4.2.1'
- eslint@8.56.0
- '@typescript-eslint/eslint-plugin@7.9.0'
- '@typescript-eslint/parser@7.9.0'
- 'eslint-config-prettier@9.1.0'
- 'eslint-plugin-prettier@5.1.3'

- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
types: [file]
types_or: [python, markdown]

- repo: https://github.com/rhysd/actionlint
rev: 'v1.7.0'
hooks:
- id: actionlint
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inputs:
default: ''

runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'

branding:
Expand Down
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = [
{
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
env: {
es6: true,
node: true,
},
rules: {
'no-var': 'error',
semi: ['error', 'never'],
indent: ['error', 2],
'no-multi-spaces': 'error',
'space-in-parens': 'error',
'no-multiple-empty-lines': 'error',
'prefer-const': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
},
},
]
6 changes: 3 additions & 3 deletions integrationtests/prepare_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def write_initial_settings():
"""Write initial settings to a file"""
"""Write initial settings to a file."""
initial_settings = {
"executable": sys.executable,
"version_info": str(sys.version_info),
Expand All @@ -15,13 +15,13 @@ def write_initial_settings():


def read_initial_settings():
"""Read initial settings to a file"""
"""Read initial settings to a file."""
with open("initial_settings.json") as f:
return json.load(f)


def run_cmd(cmd):
"""Run shell command in a python2/3 compatible way"""
"""Run shell command in a python2/3 compatible way."""
process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True
)
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@


def test_conda_installed():
"""Conda is callable from the shell"""
"""Conda is callable from the shell."""
returncode, stdout, stderr = run_cmd("conda --version")
assert returncode == 0
assert stdout.startswith(b"conda")
assert stderr == b""


def test_conda_channels():
"""Conda channels are added in order"""
"""Conda channels are added in order."""
returncode, stdout, stderr = run_cmd(" conda config --show channels")
expected = os.environ["CONDA_CHANNELS"].split(",")
channel_list = stdout.decode().partition(":")[2].split(" - ")
Expand Down
4 changes: 2 additions & 2 deletions integrationtests/test_installed_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@


def test_pandoc_installed():
"""Pandoc is callable from the shell"""
"""Pandoc is callable from the shell."""
returncode, stdout, stderr = run_cmd("pandoc -v")
assert returncode == 0
assert stdout.startswith(b"pandoc")
assert stderr == b""


def test_garphviz_installed():
"""Graphviz is installed"""
"""Graphviz is installed."""
if sys.platform == "win32":
returncode, stdout, stderr = run_cmd("dot.bat -V")
else:
Expand Down
8 changes: 4 additions & 4 deletions integrationtests/test_python_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@

@pytest.mark.skipif("NOT_ACTIVATED" not in os.environ, reason="Conda python is used")
def test_python_not_changed():
"""Same python as initially"""
"""Same python as initially."""
initial_settings = read_initial_settings()
assert initial_settings["executable"] == sys.executable
assert initial_settings["version_info"] == str(sys.version_info)


@pytest.mark.skipif("NOT_ACTIVATED" in os.environ, reason="Conda python is not used")
def test_python_from_conda():
"""Same python if from conda"""
"""Same python if from conda."""
initial_settings = read_initial_settings()
assert initial_settings["executable"] != sys.executable
assert "miniconda" in sys.executable.lower()


@pytest.mark.skipif("ENV_PYTHON" not in os.environ, reason="Not a conda custom python")
def test_custom_python_from_conda():
"""Same python if from conda"""
"""Same python if from conda."""
assert sys.version.startswith(os.environ["ENV_PYTHON"])


@pytest.mark.skipif("PYPY_TEST" not in os.environ, reason="Not a pypy test")
def test_pypy_from_conda():
"""Installed python version is PyPy"""
"""Installed python version is PyPy."""
assert sys.version.splitlines()[1].startswith("[PyPy")
Loading

0 comments on commit 6beb34d

Please sign in to comment.