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

Added Makefile #20

Merged
merged 1 commit into from
Aug 15, 2023
Merged

Added Makefile #20

merged 1 commit into from
Aug 15, 2023

Conversation

wakaree
Copy link
Contributor

@wakaree wakaree commented Aug 14, 2023

Added Makefile for easier code linting & reformatting

@RootShinobi RootShinobi merged commit 7a71480 into aiogram:dev Aug 15, 2023
18 checks passed
RootShinobi added a commit that referenced this pull request Aug 22, 2023
* context + td

* Some improvements
- Fixed type-hints
- Fixed LazyProxy model serialization
- Fixed TextDecoration stub when parse mode is not defined
- Click dependency version range changed
- Improved FluentToken extractor to parse syntactic sugar like 'i18n.hello.world()'

* Fixed typo

* fixed typo x2

* ADD FluentMultipleKeyParser
ADD BaseFluentKeyParser
Refactor FluentKeyParser to use Path instead of str
Fix `locale=` in i18n.get(...) not to be gathered by parser

Now Parsers accepts `locales`, which will create sub-dirs (eg. `uk`, `en`). If locales is None - no sub-dirs will be created.

FluentMultipleKeyParser parses locale-tokens in code and split them by separator. [`token.split(maxsplit=1)`]
First element of local-token is used to create sub-ftl-files for them.
Also u can pass locales and create sub-dirs with sub-ftl-files.

The code was formatted by Black + Ruff.

* Update pyproject.toml

* Refactored CLI
Fixed path building in fluent-token parser

* Update tests.yml

* + stub tree

* + gnutext stub + stubtree

* + RedisManager + startup/shutdown for Managers

* Linters, reformat code

* Update actions

* Temporarily enable CI for current branch

* Empty-Commit

* Disable current branch

* Disable ruff for examples

* Added pytest-cov

* Fixed build command

* Remove codecov step

* Enable post-install

* Fixed check installable on windows

* Update aiogram_i18n/cores/fluent_runtime_core.py

* + LocaleGetter

* Small refactoring & type-hints fix (#19)

* Updated pyproject.toml

* Code refactoring, fixed type-hints

* Added __init__ methods to aiogram_i18n.types

* Reformatted aiogram_i18n.types

* Replaced "Ellipsis" to "pass" in abstract methods

* Reformatted aiogram_i18n/types.py by ruff

* 🥴

* stub class_name

* SmartGNUTranslations + MemoryManager

* Added Makefile (#20)

* cleanup stun generator

* 1.3

* core optional locale

* tests core optional locale

* Delete gnu_translations.py

* - isort

* off multiple extract tests

* LazyProxy as filter

* + locales map

* + types hints fix

* + fix

* + fix

* New exception and mypy issues fix (#21)

* Added Makefile

* Added 'UnknownLocaleError' exception, fixed mypy issues

---------

Co-authored-by: nullmatawasoradesu <119107850+wakaree@users.noreply.github.com>
Co-authored-by: andrew000 <11490628+andrew000@users.noreply.github.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
RootShinobi added a commit that referenced this pull request Aug 22, 2023
* 1.3 (#22)

* context + td

* Some improvements
- Fixed type-hints
- Fixed LazyProxy model serialization
- Fixed TextDecoration stub when parse mode is not defined
- Click dependency version range changed
- Improved FluentToken extractor to parse syntactic sugar like 'i18n.hello.world()'

* Fixed typo

* fixed typo x2

* ADD FluentMultipleKeyParser
ADD BaseFluentKeyParser
Refactor FluentKeyParser to use Path instead of str
Fix `locale=` in i18n.get(...) not to be gathered by parser

Now Parsers accepts `locales`, which will create sub-dirs (eg. `uk`, `en`). If locales is None - no sub-dirs will be created.

FluentMultipleKeyParser parses locale-tokens in code and split them by separator. [`token.split(maxsplit=1)`]
First element of local-token is used to create sub-ftl-files for them.
Also u can pass locales and create sub-dirs with sub-ftl-files.

The code was formatted by Black + Ruff.

* Update pyproject.toml

* Refactored CLI
Fixed path building in fluent-token parser

* Update tests.yml

* + stub tree

* + gnutext stub + stubtree

* + RedisManager + startup/shutdown for Managers

* Linters, reformat code

* Update actions

* Temporarily enable CI for current branch

* Empty-Commit

* Disable current branch

* Disable ruff for examples

* Added pytest-cov

* Fixed build command

* Remove codecov step

* Enable post-install

* Fixed check installable on windows

* Update aiogram_i18n/cores/fluent_runtime_core.py

* + LocaleGetter

* Small refactoring & type-hints fix (#19)

* Updated pyproject.toml

* Code refactoring, fixed type-hints

* Added __init__ methods to aiogram_i18n.types

* Reformatted aiogram_i18n.types

* Replaced "Ellipsis" to "pass" in abstract methods

* Reformatted aiogram_i18n/types.py by ruff

* 🥴

* stub class_name

* SmartGNUTranslations + MemoryManager

* Added Makefile (#20)

* cleanup stun generator

* 1.3

* core optional locale

* tests core optional locale

* Delete gnu_translations.py

* - isort

* off multiple extract tests

* LazyProxy as filter

* + locales map

* + types hints fix

* + fix

* + fix

* New exception and mypy issues fix (#21)

* Added Makefile

* Added 'UnknownLocaleError' exception, fixed mypy issues

---------

Co-authored-by: nullmatawasoradesu <119107850+wakaree@users.noreply.github.com>
Co-authored-by: andrew000 <11490628+andrew000@users.noreply.github.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

* Update python-publish.yml

---------

Co-authored-by: nullmatawasoradesu <119107850+wakaree@users.noreply.github.com>
Co-authored-by: andrew000 <11490628+andrew000@users.noreply.github.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
RootShinobi added a commit that referenced this pull request Sep 27, 2023
* context + td

* Some improvements
- Fixed type-hints
- Fixed LazyProxy model serialization
- Fixed TextDecoration stub when parse mode is not defined
- Click dependency version range changed
- Improved FluentToken extractor to parse syntactic sugar like 'i18n.hello.world()'

* Fixed typo

* fixed typo x2

* ADD FluentMultipleKeyParser
ADD BaseFluentKeyParser
Refactor FluentKeyParser to use Path instead of str
Fix `locale=` in i18n.get(...) not to be gathered by parser

Now Parsers accepts `locales`, which will create sub-dirs (eg. `uk`, `en`). If locales is None - no sub-dirs will be created.

FluentMultipleKeyParser parses locale-tokens in code and split them by separator. [`token.split(maxsplit=1)`]
First element of local-token is used to create sub-ftl-files for them.
Also u can pass locales and create sub-dirs with sub-ftl-files.

The code was formatted by Black + Ruff.

* Update pyproject.toml

* Refactored CLI
Fixed path building in fluent-token parser

* Update tests.yml

* + stub tree

* + gnutext stub + stubtree

* + RedisManager + startup/shutdown for Managers

* Linters, reformat code

* Update actions

* Temporarily enable CI for current branch

* Empty-Commit

* Disable current branch

* Disable ruff for examples

* Added pytest-cov

* Fixed build command

* Remove codecov step

* Enable post-install

* Fixed check installable on windows

* Update aiogram_i18n/cores/fluent_runtime_core.py

* + LocaleGetter

* Small refactoring & type-hints fix (#19)

* Updated pyproject.toml

* Code refactoring, fixed type-hints

* Added __init__ methods to aiogram_i18n.types

* Reformatted aiogram_i18n.types

* Replaced "Ellipsis" to "pass" in abstract methods

* Reformatted aiogram_i18n/types.py by ruff

* 🥴

* stub class_name

* SmartGNUTranslations + MemoryManager

* Added Makefile (#20)

* cleanup stun generator

* 1.3

* core optional locale

* tests core optional locale

* Delete gnu_translations.py

* - isort

* off multiple extract tests

* LazyProxy as filter

* + locales map

* + types hints fix

* + fix

* + fix

* New exception and mypy issues fix (#21)

* Added Makefile

* Added 'UnknownLocaleError' exception, fixed mypy issues

* Main (#23)

* 1.3 (#22)

* context + td

* Some improvements
- Fixed type-hints
- Fixed LazyProxy model serialization
- Fixed TextDecoration stub when parse mode is not defined
- Click dependency version range changed
- Improved FluentToken extractor to parse syntactic sugar like 'i18n.hello.world()'

* Fixed typo

* fixed typo x2

* ADD FluentMultipleKeyParser
ADD BaseFluentKeyParser
Refactor FluentKeyParser to use Path instead of str
Fix `locale=` in i18n.get(...) not to be gathered by parser

Now Parsers accepts `locales`, which will create sub-dirs (eg. `uk`, `en`). If locales is None - no sub-dirs will be created.

FluentMultipleKeyParser parses locale-tokens in code and split them by separator. [`token.split(maxsplit=1)`]
First element of local-token is used to create sub-ftl-files for them.
Also u can pass locales and create sub-dirs with sub-ftl-files.

The code was formatted by Black + Ruff.

* Update pyproject.toml

* Refactored CLI
Fixed path building in fluent-token parser

* Update tests.yml

* + stub tree

* + gnutext stub + stubtree

* + RedisManager + startup/shutdown for Managers

* Linters, reformat code

* Update actions

* Temporarily enable CI for current branch

* Empty-Commit

* Disable current branch

* Disable ruff for examples

* Added pytest-cov

* Fixed build command

* Remove codecov step

* Enable post-install

* Fixed check installable on windows

* Update aiogram_i18n/cores/fluent_runtime_core.py

* + LocaleGetter

* Small refactoring & type-hints fix (#19)

* Updated pyproject.toml

* Code refactoring, fixed type-hints

* Added __init__ methods to aiogram_i18n.types

* Reformatted aiogram_i18n.types

* Replaced "Ellipsis" to "pass" in abstract methods

* Reformatted aiogram_i18n/types.py by ruff

* 🥴

* stub class_name

* SmartGNUTranslations + MemoryManager

* Added Makefile (#20)

* cleanup stun generator

* 1.3

* core optional locale

* tests core optional locale

* Delete gnu_translations.py

* - isort

* off multiple extract tests

* LazyProxy as filter

* + locales map

* + types hints fix

* + fix

* + fix

* New exception and mypy issues fix (#21)

* Added Makefile

* Added 'UnknownLocaleError' exception, fixed mypy issues

---------

Co-authored-by: nullmatawasoradesu <119107850+wakaree@users.noreply.github.com>
Co-authored-by: andrew000 <11490628+andrew000@users.noreply.github.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

* Update python-publish.yml

---------

Co-authored-by: nullmatawasoradesu <119107850+wakaree@users.noreply.github.com>
Co-authored-by: andrew000 <11490628+andrew000@users.noreply.github.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

* Rework multiple-extract (#24)

* Rework multiple-extract
Rework FluentTemplateDir
Add `--default-ftl-file` parameter to multiple-extract
Refactor libcst tree parser to search `Call(func=Name)` such as I18NFormat("Key")
Rework `BaseCore._extract_locales`
Rework `BaseCore._find_locales` to search files recursively
Refactor `FluentCompileCore` to accept `path` argument as `str` or `Path`
Refactor `FluentRuntimeCore` to accept `path` argument as `str` or `Path`
Refactor `GNUTextCore` to accept `path` argument as `str` or `Path`
Optimize directories creation if `create_missing_dirs=True`
Add simple test-code
Reworked multiple-extract tests
Add `C901` to ignore (too complex)

* ADD new tests

* Rework TMP directories for tests

* Update .gitignore

* Exclude `tests/data/test_code` from `ruff check` during GH Workflows

* Revert "Exclude `tests/data/test_code` from `ruff check` during GH Workflows"

This reverts commit 2c2da85.

* Make Temporary `test_code` DIR
Refactor test_extract.py
Refactor test_multiple_extract.py
Rename simple_code.py to sample_code.txt

* 1.3.1

* pre

* fluent fix number

* fix

---------

Co-authored-by: nullmatawasoradesu <119107850+wakaree@users.noreply.github.com>
Co-authored-by: andrew000 <11490628+andrew000@users.noreply.github.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
@RootShinobi RootShinobi mentioned this pull request Sep 27, 2023
RootShinobi added a commit that referenced this pull request Sep 27, 2023
* context + td

* Some improvements
- Fixed type-hints
- Fixed LazyProxy model serialization
- Fixed TextDecoration stub when parse mode is not defined
- Click dependency version range changed
- Improved FluentToken extractor to parse syntactic sugar like 'i18n.hello.world()'

* Fixed typo

* fixed typo x2

* ADD FluentMultipleKeyParser
ADD BaseFluentKeyParser
Refactor FluentKeyParser to use Path instead of str
Fix `locale=` in i18n.get(...) not to be gathered by parser

Now Parsers accepts `locales`, which will create sub-dirs (eg. `uk`, `en`). If locales is None - no sub-dirs will be created.

FluentMultipleKeyParser parses locale-tokens in code and split them by separator. [`token.split(maxsplit=1)`]
First element of local-token is used to create sub-ftl-files for them.
Also u can pass locales and create sub-dirs with sub-ftl-files.

The code was formatted by Black + Ruff.

* Update pyproject.toml

* Refactored CLI
Fixed path building in fluent-token parser

* Update tests.yml

* + stub tree

* + gnutext stub + stubtree

* + RedisManager + startup/shutdown for Managers

* Linters, reformat code

* Update actions

* Temporarily enable CI for current branch

* Empty-Commit

* Disable current branch

* Disable ruff for examples

* Added pytest-cov

* Fixed build command

* Remove codecov step

* Enable post-install

* Fixed check installable on windows

* Update aiogram_i18n/cores/fluent_runtime_core.py

* + LocaleGetter

* Small refactoring & type-hints fix (#19)

* Updated pyproject.toml

* Code refactoring, fixed type-hints

* Added __init__ methods to aiogram_i18n.types

* Reformatted aiogram_i18n.types

* Replaced "Ellipsis" to "pass" in abstract methods

* Reformatted aiogram_i18n/types.py by ruff

* 🥴

* stub class_name

* SmartGNUTranslations + MemoryManager

* Added Makefile (#20)

* cleanup stun generator

* 1.3

* core optional locale

* tests core optional locale

* Delete gnu_translations.py

* - isort

* off multiple extract tests

* LazyProxy as filter

* + locales map

* + types hints fix

* + fix

* + fix

* New exception and mypy issues fix (#21)

* Added Makefile

* Added 'UnknownLocaleError' exception, fixed mypy issues

* Main (#23)

* 1.3 (#22)

* context + td

* Some improvements
- Fixed type-hints
- Fixed LazyProxy model serialization
- Fixed TextDecoration stub when parse mode is not defined
- Click dependency version range changed
- Improved FluentToken extractor to parse syntactic sugar like 'i18n.hello.world()'

* Fixed typo

* fixed typo x2

* ADD FluentMultipleKeyParser
ADD BaseFluentKeyParser
Refactor FluentKeyParser to use Path instead of str
Fix `locale=` in i18n.get(...) not to be gathered by parser

Now Parsers accepts `locales`, which will create sub-dirs (eg. `uk`, `en`). If locales is None - no sub-dirs will be created.

FluentMultipleKeyParser parses locale-tokens in code and split them by separator. [`token.split(maxsplit=1)`]
First element of local-token is used to create sub-ftl-files for them.
Also u can pass locales and create sub-dirs with sub-ftl-files.

The code was formatted by Black + Ruff.

* Update pyproject.toml

* Refactored CLI
Fixed path building in fluent-token parser

* Update tests.yml

* + stub tree

* + gnutext stub + stubtree

* + RedisManager + startup/shutdown for Managers

* Linters, reformat code

* Update actions

* Temporarily enable CI for current branch

* Empty-Commit

* Disable current branch

* Disable ruff for examples

* Added pytest-cov

* Fixed build command

* Remove codecov step

* Enable post-install

* Fixed check installable on windows

* Update aiogram_i18n/cores/fluent_runtime_core.py

* + LocaleGetter

* Small refactoring & type-hints fix (#19)

* Updated pyproject.toml

* Code refactoring, fixed type-hints

* Added __init__ methods to aiogram_i18n.types

* Reformatted aiogram_i18n.types

* Replaced "Ellipsis" to "pass" in abstract methods

* Reformatted aiogram_i18n/types.py by ruff

* 🥴

* stub class_name

* SmartGNUTranslations + MemoryManager

* Added Makefile (#20)

* cleanup stun generator

* 1.3

* core optional locale

* tests core optional locale

* Delete gnu_translations.py

* - isort

* off multiple extract tests

* LazyProxy as filter

* + locales map

* + types hints fix

* + fix

* + fix

* New exception and mypy issues fix (#21)

* Added Makefile

* Added 'UnknownLocaleError' exception, fixed mypy issues

---------





* Update python-publish.yml

---------





* Rework multiple-extract (#24)

* Rework multiple-extract
Rework FluentTemplateDir
Add `--default-ftl-file` parameter to multiple-extract
Refactor libcst tree parser to search `Call(func=Name)` such as I18NFormat("Key")
Rework `BaseCore._extract_locales`
Rework `BaseCore._find_locales` to search files recursively
Refactor `FluentCompileCore` to accept `path` argument as `str` or `Path`
Refactor `FluentRuntimeCore` to accept `path` argument as `str` or `Path`
Refactor `GNUTextCore` to accept `path` argument as `str` or `Path`
Optimize directories creation if `create_missing_dirs=True`
Add simple test-code
Reworked multiple-extract tests
Add `C901` to ignore (too complex)

* ADD new tests

* Rework TMP directories for tests

* Update .gitignore

* Exclude `tests/data/test_code` from `ruff check` during GH Workflows

* Revert "Exclude `tests/data/test_code` from `ruff check` during GH Workflows"

This reverts commit 2c2da85.

* Make Temporary `test_code` DIR
Refactor test_extract.py
Refactor test_multiple_extract.py
Rename simple_code.py to sample_code.txt

* 1.3.1

* pre

* fluent fix number

* fix

---------

Co-authored-by: nullmatawasoradesu <119107850+wakaree@users.noreply.github.com>
Co-authored-by: andrew000 <11490628+andrew000@users.noreply.github.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants