diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..c3a4d11 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Lint + +on: + pull_request: + branches: [ main ] + +jobs: + lint: + strategy: + fail-fast: false + matrix: + linter: [ + {"name": "flake8", "format": "flake8", "cwd": ".", "cmd": "flake8 ."}, + {"name": "mypy", "format": "mypy", "cwd": ".", "cmd": "mypy ."}, + {"name": "pylint", "format": "pylint-json", "cwd": ".", "cmd": "pylint --load-plugins pylint_pytest $(Get-ChildItem -Filter *.py -Recurse .)"}, + ] + name: ${{ matrix.linter.name }} + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install Python dependencies + run: | + py -m pip install --upgrade pip + py -m pip install git+https://github.com/bugale/Bugalintly.git@bugalintly + py -m pip install .[dev] + Remove-Item -Recurse -Force build + - name: Lint + run: | + cd ${{ matrix.linter.cwd }} + ${{ matrix.linter.cmd }} > lint.log + $exitcode = $LASTEXITCODE + type lint.log | Lintly --log --no-request-changes --no-review-body --base-dir . --format=${{ matrix.linter.format }} --comment-tag=${{ matrix.linter.name }} + exit $exitcode + env: + LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..afc6177 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: Test + +on: + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install test dependencies + run: | + python -m pip install --upgrade pip + python -m pip install .[tests] + - name: Test + run: | + pytest tests diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2ef546 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**\__pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e624a3a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,13 @@ +{ + "python.linting.enabled": true, + "python.linting.flake8Enabled": true, + "python.linting.flake8Args": [], + "python.linting.mypyEnabled": true, + "python.linting.mypyArgs": ["--follow-imports=silent"], + "python.linting.pylintEnabled": true, + "python.linting.pylintArgs": ["--load-plugins", "pylint_pytest"], + "python.testing.pytestEnabled": true, + "files.associations": { + "*.yaml": "home-assistant" + } +} diff --git a/README.md b/README.md index 7212bb3..256e15c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# bugonomics -Economics Python Library +# Bugonomics +A Pytohn library for calculating economics-related stuff. diff --git a/bugonomics/__init__.py b/bugonomics/__init__.py new file mode 100644 index 0000000..c496e6e --- /dev/null +++ b/bugonomics/__init__.py @@ -0,0 +1,3 @@ +from bugonomics.salary import Salary + +__all__ = ['Salary'] diff --git a/bugonomics/py.typed b/bugonomics/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/bugonomics/salary.py b/bugonomics/salary.py new file mode 100644 index 0000000..424af01 --- /dev/null +++ b/bugonomics/salary.py @@ -0,0 +1,2 @@ +class Salary: + pass diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..2406232 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,18 @@ +[flake8] +max-line-length = 160 + +[mypy] +namespace_packages = True +strict = True +show_error_codes = True +show_column_numbers = True + +[tool:pytest] +log_cli = 1 +log_cli_level = DEBUG +filterwarnings = error + +[pylint.config] +max-line-length = 160 +output-format = json +disable = missing-module-docstring,missing-class-docstring,missing-function-docstring diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..433c848 --- /dev/null +++ b/setup.py @@ -0,0 +1,51 @@ +import os +import setuptools + + +def read(*parts: str) -> str: + with open(os.path.join(os.path.dirname(__file__), *parts), encoding='utf-8') as file: + return file.read() + + +setuptools.setup( + name='bugonomics', + version='1.0.0', + url='https://github.com/bugale/bugonomics', + license='MIT', + author='Bugale', + author_email='bugalit@gmail.com', + description='A Pytohn library for calculating economics-related stuff.', + long_description=read('README.md'), + long_description_content_type='text/markdown', + packages=['bugonomics'], + include_package_data=True, + zip_safe=False, + platforms='any', + install_requires=[ + ], + extras_require={ + 'tests': [ + 'pytest', + ], + 'dev': [ + 'flake8', + 'mypy', + 'pylint', + 'types-setuptools', + ], + }, + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: POSIX', + 'Operating System :: MacOS', + 'Operating System :: Unix', + 'Operating System :: Microsoft :: Windows', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.10', + 'Topic :: Software Development :: Libraries :: Python Modules', + ] +) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_bugonomics.py b/tests/test_bugonomics.py new file mode 100644 index 0000000..f78349c --- /dev/null +++ b/tests/test_bugonomics.py @@ -0,0 +1,5 @@ +from bugonomics import Salary + + +def test_salary() -> None: + Salary()