Skip to content
Draft
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
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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 }}
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**\__pycache__
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# bugonomics
Economics Python Library
# Bugonomics
A Pytohn library for calculating economics-related stuff.
3 changes: 3 additions & 0 deletions bugonomics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from bugonomics.salary import Salary

__all__ = ['Salary']
Empty file added bugonomics/py.typed
Empty file.
2 changes: 2 additions & 0 deletions bugonomics/salary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Salary:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R0903 (too-few-public-methods): Too few public methods (0/2) (pylint)

pass
18 changes: 18 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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
51 changes: 51 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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',
]
)
Empty file added tests/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions tests/test_bugonomics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from bugonomics import Salary


def test_salary() -> None:
Salary()