Skip to content

Setup: Init - Initial setup.py and basic configs - #4

Merged
Yifan Xiong (abuccts) merged 10 commits into
devfrom
xiongyf/setup-py
Jan 28, 2021
Merged

Setup: Init - Initial setup.py and basic configs#4
Yifan Xiong (abuccts) merged 10 commits into
devfrom
xiongyf/setup-py

Conversation

@abuccts

@abucctsYifan Xiong (abuccts) commented Jan 27, 2021

Copy link
Copy Markdown
Member

Initialize setup.py and basic configurations for this project.

Major revisions:

  • initialize setup.py for Python package
  • add gitignore and dockerignore
  • add editorconfig for editors
  • configure yapf for auto formating
  • configure mypy for type hint
  • configure flake8 for lint, including quotes and docstrings
  • add pre-commit check for git commit
  • add spelling check in GitHub Actions
  • format existing files according to configured rules

Example usage:

# install dependencies
$ python3 -m pip install -e .[dev,test]
$ pre-commit install
# format code automatically
$ python3 setup.py format
# lint code
$ python3 setup.py lint
# test code
$ python3 setup.py test

* inital setup.py
* add gitignore and dockerignore
* add editorconfig
* add yapf, mypy, flake8 for type check and lint
Comment thread.style.yapf Outdated
Comment thread.flake8 Outdated
Update max-line-length in lint, use default 79.
Comment threadsetup.cfg Outdated
Comment threadsetup.py
Comment threadsetup.py Outdated
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: System :: Benchmark",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TobeyQin would you please check it?

@cp5555Peng Cheng (cp5555) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would you please double check with TobeyQin about the category?

@abuccts

Copy link
Copy Markdown
MemberAuthor

Would you please double check with TobeyQin about the category?

TobeyQin pls refer to classifiers list

Update according to comments.
Comment threadtest.dockerfile Outdated
Comment thread.gitignore
* follow [pep257](https://www.python.org/dev/peps/pep-0257/),
use single quote for inline quotes and double quote for
multiline/docstring
* require docstring in `superbench/`
* require typed defs in `superbench/`
Add spelling check for typo.
Fix warning and typo.
Add pre-commit config.
Comment threadsuperbench/__init__.py Outdated
Comment threadsetup.py Outdated
Comment threadsetup.py
Comment thread.pre-commit-config.yaml
Comment thread.flake8 Outdated
Comment thread.mypy.ini
@abuccts
Yifan Xiong (abuccts) requested a review from a team as a code ownerJanuary 28, 2021 02:29
Add docstrings and remove exception rules.
@abuccts
Yifan Xiong (abuccts) deleted the xiongyf/setup-py branch January 28, 2021 13:01
@cp5555Peng Cheng (cp5555) added test Unit tests, lint or format check related CI/CD Continuous integration or deployment labels Feb 5, 2021
Yifan Xiong (abuccts) added a commit that referenced this pull request Apr 13, 2021
Initialize setup.py and basic configurations for this project.
Major revisions:
- initialize setup.py for Python package
- add gitignore and dockerignore
- add editorconfig for editors
- configure yapf for auto formating
- configure mypy for type hint
- configure flake8 for lint, including quotes and docstrings
- add pre-commit check for `git commit`
- add spelling check in GitHub Actions
- format existing files according to configured rules
Example usage:
# install dependencies
$ python3 -m pip install -e .[dev,test]
$ pre-commit install
# format code automatically
$ python3 setup.py format
# lint code
$ python3 setup.py lint
# test code
$ python3 setup.py test
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CDContinuous integration or deploymenttestUnit tests, lint or format check related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@abuccts@cp5555@guoshzhao