generated from KOLANICH/python_project_boilerplate.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e04ffdd
Showing
22 changed files
with
972 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 4 | ||
insert_final_newline = true | ||
end_of_line = lf | ||
|
||
[*.{yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
KOLANICH/python_project_boilerplate.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
allow: | ||
- dependency-type: "all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: typical python workflow | ||
uses: KOLANICH-GHActions/typical-python-workflow@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
closure-compiler-*.jar | ||
compiler_uberjar_deploy.jar | ||
|
||
__pycache__ | ||
*.py[co] | ||
/*.egg-info | ||
*.srctrlbm | ||
*.srctrldb | ||
build | ||
dist | ||
.eggs | ||
monkeytype.sqlite3 | ||
/.ipynb_checkpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
image: registry.gitlab.com/kolanich-subgroups/docker-images/fixed_python:latest | ||
|
||
variables: | ||
DOCKER_DRIVER: overlay2 | ||
SAST_ANALYZER_IMAGE_TAG: latest | ||
SAST_DISABLE_DIND: "true" | ||
SAST_CONFIDENCE_LEVEL: 5 | ||
CODECLIMATE_VERSION: latest | ||
|
||
include: | ||
- template: SAST.gitlab-ci.yml | ||
- template: Code-Quality.gitlab-ci.yml | ||
- template: License-Management.gitlab-ci.yml | ||
|
||
build: | ||
tags: | ||
- shared | ||
- linux | ||
stage: build | ||
variables: | ||
GIT_DEPTH: "1" | ||
PYTHONUSERBASE: ${CI_PROJECT_DIR}/python_user_packages | ||
|
||
before_script: | ||
- export PATH="$PATH:$PYTHONUSERBASE/bin" # don't move into `variables` | ||
- apt-get update | ||
# todo: | ||
#- apt-get -y install | ||
#- pip3 install --upgrade | ||
#- python3 ./fix_python_modules_paths.py | ||
|
||
script: | ||
- python3 -m build -nw bdist_wheel | ||
- mv ./dist/*.whl ./dist/ClosureCompiler-0.CI-py3-none-any.whl | ||
- pip3 install --upgrade ./dist/*.whl | ||
- coverage run --source=ClosureCompiler -m --branch pytest --junitxml=./rspec.xml ./tests/test.py | ||
- coverage report -m | ||
- coverage xml | ||
|
||
coverage: "/^TOTAL(?:\\s+\\d+){4}\\s+(\\d+%).+/" | ||
|
||
cache: | ||
paths: | ||
- $PYTHONUSERBASE | ||
|
||
artifacts: | ||
paths: | ||
- dist | ||
reports: | ||
junit: ./rspec.xml | ||
cobertura: ./coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: Closure Compiler | ||
Source: https://github.com/google/closure-compiler | ||
|
||
Files: ClosureCompiler/lowLevel.py ClosureCompiler/__init__.py | ||
Copyright: | ||
2002 The Closure Compiler Authors | ||
2007 Google Inc | ||
2010 The Closure Library Authors | ||
2011 PicNet Pty Ltd | ||
2012 YouTube LLC | ||
KOLANICH, 2023 | ||
License: Apache-2.0 | ||
|
||
Files: reuse/dep5 | ||
Copyright: | ||
2013 Thomas Koch <thomas@koch.ro> | ||
2018 Charlie Powell <charlie@evalagency.com> | ||
KOLANICH, 2023 | ||
License: Apache-2.0 | ||
|
||
Files: .editorconfig .gitlab-ci.yml .gitignore ReadMe.md pyproject.toml Code_Of_Conduct.md MANIFEST.in tests/* .github/* ClosureCompiler/util.py ClosureCompiler/enums.py | ||
Copyright: KOLANICH, 2023 | ||
License: Unlicense |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import typing | ||
from pathlib import Path | ||
|
||
from .enums import TypeInferMode | ||
from .lowLevel import * | ||
from .lowLevel import _optionsComponentTypes, _otherEssentialClasses | ||
|
||
__all__ = ("SourcesMappingTU", "Compiler", "createCompilerOptions") + _optionsComponentTypes + _otherEssentialClasses | ||
|
||
|
||
class ClosureCompilerErrror(RuntimeError): | ||
__slots__ = () | ||
|
||
|
||
class Compiler: | ||
__slots__ = ("compiler", "options") | ||
|
||
def __init__(self, options: typing.Optional[CompilerOptions] = None) -> None: | ||
if options is None: | ||
options = createCompilerOptions() | ||
|
||
self.options = options | ||
self.compiler = None | ||
|
||
@property | ||
def _jsRoot(self): | ||
prop = ji.reflectClass(self.compiler.__class__).getDeclaredField("jsRoot") | ||
prop.setAccessible(True) | ||
return prop.get(self.compiler) | ||
|
||
def getBuiltInExterns(self): | ||
return getBuiltInExterns(self.options.getEnvironment()) | ||
|
||
def __call__(self, sources: SourcesMappingTU, externs: typing.Optional[SourcesMappingTU] = None) -> Result: | ||
return self.compile(sources, externs) | ||
|
||
def compile(self, sources: SourcesMappingTU, externs: typing.Optional[SourcesMappingTU] = None) -> Result: | ||
sources = convertSourcesMapping(sources) | ||
|
||
builtinExterns = self.getBuiltInExterns() | ||
if externs: | ||
externs = convertSourcesMapping(externs) | ||
else: | ||
externs = [] | ||
|
||
self.compiler = ji.Compiler() | ||
lowLevelRes = self.compiler.compile( | ||
ji.ArrayList(externs + builtinExterns), | ||
ji.ArrayList(sources), | ||
self.options, | ||
) | ||
|
||
return Result.fromNativeResult(str(self.compiler.toSource()), lowLevelRes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from enum import IntFlag | ||
|
||
|
||
class TypeInferMode(IntFlag): | ||
none = 0b00 | ||
check = 0b01 | ||
infer = 0b10 |
Oops, something went wrong.