Skip to content

Update linter #177

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

Merged
merged 5 commits into from
Feb 7, 2023
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
12 changes: 6 additions & 6 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
Expand All @@ -40,7 +40,7 @@ jobs:
run: |
./scripts/build-docs python-fluent
- name: artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: html
path: |
Expand All @@ -52,14 +52,14 @@ jobs:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: html
path: _build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.0.0
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: _build # The folder the action should deploy.
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/fluent.integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ on:
- master
paths:
- .github/workflows/fluent.integration.yml
- 'fluent.syntax/**'
- '!fluent.syntax/docs/**'
- 'fluent.runtime/**'
- '!fluent.runtime/docs/**'
- "fluent.syntax/**"
- "!fluent.syntax/docs/**"
- "fluent.runtime/**"
- "!fluent.runtime/docs/**"
pull_request:
branches:
- master
paths:
- .github/workflows/fluent.integration.yml
- 'fluent.syntax/**'
- '!fluent.syntax/docs/**'
- 'fluent.runtime/**'
- '!fluent.runtime/docs/**'
- "fluent.syntax/**"
- "!fluent.syntax/docs/**"
- "fluent.runtime/**"
- "!fluent.runtime/docs/**"

jobs:
integration:
name: fluent.runtime
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/fluent.runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ on:
- master
paths:
- .github/workflows/fluent.runtime.yml
- 'fluent.runtime/**'
- '!fluent.runtime/docs/**'
- "fluent.runtime/**"
- "!fluent.runtime/docs/**"
pull_request:
branches:
- master
paths:
- .github/workflows/fluent.runtime.yml
- 'fluent.runtime/**'
- '!fluent.runtime/docs/**'
- "fluent.runtime/**"
- "!fluent.runtime/docs/**"

jobs:
unit:
name: unit tests
runs-on: ubuntu-latest
runs-on: ubuntu-20.04 # https://github.com/actions/setup-python/issues/544
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
python-version: [3.6, 3.7, 3.8, 3.9, pypy3.9]
fluent-syntax: [0.18.1]
include:
- python-version: 3.9
fluent-syntax: 0.17.0
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -49,16 +49,16 @@ jobs:
name: flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install wheel
python -m pip install --upgrade pip
python -m pip install flake8==3.7.9
python -m pip install flake8==6
- name: lint
working-directory: ./fluent.runtime
run: |
flake8 fluent
python -m flake8
24 changes: 12 additions & 12 deletions .github/workflows/fluent.syntax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ on:
- master
paths:
- .github/workflows/fluent.syntax.yml
- 'fluent.syntax/**'
- '!fluent.syntax/docs/**'
- "fluent.syntax/**"
- "!fluent.syntax/docs/**"
pull_request:
branches:
- master
paths:
- .github/workflows/fluent.syntax.yml
- 'fluent.syntax/**'
- '!fluent.syntax/docs/**'
- "fluent.syntax/**"
- "!fluent.syntax/docs/**"

jobs:
unit:
name: unit tests
runs-on: ubuntu-latest
runs-on: ubuntu-20.04 # https://github.com/actions/setup-python/issues/544
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
python-version: [3.6, 3.7, 3.8, 3.9, pypy3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -43,15 +43,15 @@ jobs:
name: flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8==3.7.9
python -m pip install flake8==6
- name: lint
working-directory: ./fluent.syntax
run: |
flake8
python -m flake8
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.tox
.vscode
.*
*.pyc
.eggs/
*.egg-info/
_build
build
Expand Down
4 changes: 2 additions & 2 deletions fluent.runtime/fluent/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def format_pattern(self, pattern, args=None):
return [result, errors]

def _get_babel_locale(self):
for l in self.locales:
for lc in self.locales:
try:
return babel.Locale.parse(l.replace('-', '_'))
return babel.Locale.parse(lc.replace('-', '_'))
except babel.UnknownLocaleError:
continue
# TODO - log error
Expand Down
5 changes: 3 additions & 2 deletions fluent.runtime/tools/benchmarks/fluent_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ten = Ten
"""


@pytest.fixture
def fluent_bundle():
bundle = FluentBundle(['pl'], use_isolating=False)
Expand All @@ -48,7 +49,7 @@ def fluent_template(bundle):

class TestBenchmark(object):
def test_template(self, fluent_bundle, benchmark):
result = benchmark(lambda: fluent_template(fluent_bundle))
benchmark(lambda: fluent_template(fluent_bundle))

def test_bundle(self, benchmark):
def test_bundles():
Expand All @@ -61,7 +62,7 @@ def test_imports():
# prune cached imports
fluent_deps = [
k for k in sys.modules.keys()
if k.split('.', 1)[0] in ('babel','fluent','pytz')
if k.split('.', 1)[0] in ('babel', 'fluent', 'pytz')
]
for k in fluent_deps:
del sys.modules[k]
Expand Down