Skip to content

Commit

Permalink
Merge pull request #3 from nekokatt/staging
Browse files Browse the repository at this point in the history
Removing staging branch and merging all changes since v0 into master to use tag-based deployment approach instead.
  • Loading branch information
Nekokatt authored Aug 16, 2020
2 parents 48730b9 + 3583a5d commit e0ed04f
Show file tree
Hide file tree
Showing 255 changed files with 53,737 additions and 16,734 deletions.
9 changes: 0 additions & 9 deletions .dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
ij_continuation_indent_size = 4
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
Expand Down
40 changes: 40 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[flake8]
count = true

ignore =
A002, # Argument is shadowing a python builtin.
A003, # Class attribute is shadowing a python builtin.
CFQ002, # Function has too many arguments.
D102, # Missing docstring in public method.
D105, # Magic methods not having a docstring.
D412, # No blank lines allowed between a section header and its content
E402, # Module level import not at top of file (isn't compatible with our import style).
IFSTMT001 # "use a oneliner here".
T101, # TO-DO comment detection (T102 is FIX-ME and T103 is XXX).
W503, # line break before binary operator.
W504, # line break before binary operator (again, I guess).
S101, # Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.

# F401: unused import.
# F403: cannot detect unused vars if we use starred import
# FS003: f-string missing prefix.
# R102: unnecessary parenthesis on raised exception (raises false positives in places)
per-file-ignores =
hikari/__init__.py: F401,F403
hikari/events/__init__.py: F401,F403
hikari/events/new/__init__.py: F401,F403
hikari/models/__init__.py: F401,F403
hikari/utilities/routes.py: FS003
hikari/utilities/date.py: FS003
hikari/impl/stateless_cache.py: R102

max-complexity = 20
# TODO reset to 100 again if possible.
max-function-length = 130
# Technically this is 120, but black has a policy of "1 or 2 over is fine if it is tidier", so we have to raise this.
max-line-length = 130
show_source = False
statistics = False

accept-encodings = utf-8
docstring-convention = numpy
24 changes: 17 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,38 @@ public/
# Secrets
.pypirc

# Setuptools/twine-generated files
# Setuptools/twine-generated files, compiled sources.
build/
dist/
*.egg-info/
pip-wheel-metadata/
*.so
*.o
*.pyd

# Tox/Nox-generated files
.[nt]ox/

# Coverage-generated files
.coverage*
coverage.xml
**/*,cover*

# PyTest-generated files
.pytest/
.pytest_cache/

# Pip stuff
pip-wheel-metadata/

# Poetry lockfile
poetry.lock

# Container logs
**.container.log

# Docker secrets
credentials.env

# Mypy Cache
.mypy_cache/

# Profiling in pytest
prof/

# Generated stubs for MyPy --strict hackfixes.
hikari/**/__init__.pyi
30 changes: 0 additions & 30 deletions .gitlab-ci.yml

This file was deleted.

Empty file added .gitmodules
Empty file.
3 changes: 3 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[settings]
profile = black
force_single_line = true
18 changes: 18 additions & 0 deletions .run/Unit Tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Unit Tests" type="tests" factoryName="py.test">
<module name="hikari" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/tests" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/tests&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>
134 changes: 134 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
stages:
- test
- deploy
- webhooks

cache: pip

_test_job: &test_job
install:
- ${PYTHON_COMMAND} -m pip install nox
before_script:
- mkdir public > /dev/null 2>&1 || true
- ${PYTHON_COMMAND} -V
script:
- ${PYTHON_COMMAND} -m nox --sessions pytest
- bash <(curl -s https://codecov.io/bash)

_windows_test_job: &windows_test_job
os: windows
language: shell
before_install:
- choco install --no-progress python --version=${PYTHON_VERSION} -y
env:
- PYTHON_COMMAND="py -3"
<<: *test_job

_linux_test_job: &linux_test_job
os: linux
language: python
env:
- PYTHON_COMMAND=python
<<: *test_job

env:
global:
secure: "TDaw6Ryljomk6NwuoHCtuV4PGlvBFM/GjEmhXGFTXOn32ENrh14oXWaWIw6ZmKLtekccs2kQpnN+8l5kuzqr9aHvalJzwm05RYfu3wCw09rOeXXWX0GacnCrIh2yBfYXWq/pIS0CSPO+7IRnwwLaVSqUHGXfQV5mEHNbuJTU3tAlgOqrN/L4ZWdlPiclwvKStV4VGRSqxNGEj1G10VEq0+dn6KjrhkQMpDuhQ/3o+8F0vjMNb8rQeKwogeHP3tmwEiCUoxwekjzZU9Oevc75d836/ys2hvsStF8mMtQsd4QgTMYwSWQtKHmKyqgW21nXw8TE1HcnJnc3ahfueOFMbhplJ32h7svTPuPFTaVl99+z2TG8OBbFTQEkQakc5HO7lRH0AGLmhlyXkhYIGxWCS1h266VEzVkcNAliLR/auSFKQ4XKISPZQo6ee0Cx+FkRSKm2OgLw+Nzax8AQQd89C0+hibFq3kdOx0nORpWApjz1vIyCTTEl60UtWf/wkW5o/wTiPFwoHk3k6GxHZDkXCsUb8AjxpjIt9qxo53Yu7bv3msrGLmBScxdLeDs6qdCXXWJWI1D17nhNCclXgzLrZKf5n1zBqOAQjyeoJEOTnVUCQvIHSZYErVv8s0gCArv9ONtaIfq1Vmz+E234/K+IWOYDayvcDjFna7ySgK60W9I="

jobs:
include:
# Linting
- name: "Linting"
language: python
python: "3.8.5"
os: linux
arch: amd64
install: "pip install nox"
stage: test
script:
- python -m nox --sessions safety mypy flake8

- name: "Twemoji Mapping Verification"
language: python
python: "3.8.5"
os: linux
arch: amd64
install: "pip install nox"
stage: test
script:
- python -m nox --sessions twemoji-test

- name: "Windows 10 Python 3.8.5 AMD64 Tests"
env: PYTHON_VERSION="3.8.5"
arch: amd64
stage: test
<<: *windows_test_job

- name: "Windows 10 Python 3.9 Dev AMD64 Tests"
env: PYTHON_VERSION="3.9.0-rc1 --pre"
arch: amd64
stage: test
<<: *windows_test_job

- name: "Linux Python 3.8.5 AMD64 Tests"
python: "3.8.5"
arch: amd64
stage: test
<<: *linux_test_job

- name: "Linux Python 3.9 Dev AMD64 Tests"
python: "3.9-dev"
arch: amd64
stage: test
<<: *linux_test_job

- name: "Linux Python 3.8.5 ARM64 Tests"
python: "3.8.5"
arch: arm64
stage: test
<<: *linux_test_job

- name: "Linux Python 3.9 Dev ARM64 Tests"
python: "3.9-dev"
arch: arm64
stage: test
<<: *linux_test_job

- name: "Deploy new release"
if: tag IS present AND tag =~ /^\d+\.\d+\.\d+(\..*)?$/
script:
- echo "Will deploy ${TRAVIS_TAG}"
stage: deploy
language: python
python: "3.8.5"
arch: amd64
os: linux
env:
secure: "hRjbVk8VicGkEbv/AmEJMQmWNmkC7amaPpGdaJtDC/RrfvxDXMrPFZChwi8QN42Jy28sFN0om3Fw3AQfp85ddH2itcMFeJerKOpQ2QnjOECLlgL0+6xhZqV50dj8Pd6U6BLrkSu+PXETxloSUv421ojT4dq7EgVLbQBgqs8fT5tVHB2qNIxZoOjrGFZ7Lwj5gRojnrGXf6oZt7wh/2TCnTM5GY+Zc0uAj04gwN9zZnbqWii0EcY9jRQvoE3gf0F1bTlDWjbOrDnGA+2DfZEYK9YjCztXgHwvyOBdaGn56sh9mEXH1e+OxtuJvbMQ+RDGsMW94UtiLdXJUVPyOQLFB129FscGpX5LKatlnJI1HKTi2SBEL+IxAU0NhiuzJVYSYlIAmBcgBxKuk+dxdv2QYRpFhVTKomdp1U4BZgeXFVa7XjBthXm2ng3Yrpc7lrEEmle15X8/C/yv9xeaYrnPz2SCCA3J4MkRBcg+W/+L8l68g8MKyZGamImu5ZQsso4mZ4cnbJCCAhqvtMz2ydEzhwEFx2yeowyW9PhFkF79BQhTx9ZG3I9djbgDXAu3fwXyYIloKw2DGZ8LupsQBtamHtQxq7hjdfP2fUr2tFdXR0SHzFbHAaOh2y+8wdgwW+pGT3rVRE9LbhIFtK5cDheyo+/XIhpngwKpYrSk1J2Mf0k="
deploy:
provider: pypi
username: __token__
password:
secure: "Ln2A9zpYqvQlTNbmRs7SLVyO8pbakrSQ7L0JPXkXM7CwTFfKVKnsnnvG+ktm+/qWzIdsAx3cBDBPqWrpngbFj+/YsGXgkW4mO7EM5bwFItHKnTrlpbvUn0t8gcjAj8k+gT8IA8Q9fn+5Mwun8TmrNjr7wIQLRp09ua0XF3W2OSZlbeCRmxjOqji4Ulc8NQ0GEqkqU5aUSo06/ycQsxdgDWbDYCM7tuFYmAnO3cFeC1LobTJucjSsF1cWNQClwECcfkQWMSMV6lznNru3fnD3UfSp1RImE7rCm8pCF7j2oEgkE9kHpI3CXYwHFcgJ7neYyfvXNalZG1gHwyvH92QlogSoGVNKK0kTEDP8t56oGvRjjX2Zgm85MjAX5g8348DC8lic5LaWX5rewrCwfRz2qZ4NmGvQsIRitsQcKJnUf2eecgc53wluM4ad5NGaKHI7PJD392vhfVUMoiGQg5tKUIukdeKI/+GUgylZiObpTyM2/D3YjIg8hfjmfgVizPiMatfThplXm22alIZ3I1726T5O65Kv0wShl/gzZXDoKNwaMy9PT3LoXCjm091+y7gErkoStnkxt6JbzDqvaeM/itSb5knwYXgMfmo6hQpAG4xPL4S1/COoRgIy7B6Jp4VFNoRTzV5o7sLYOjWR1LrB4dhMccamzEw6Crk1QZiipUw="
on:
tags: true
repo: nekokatt/hikari
distributions: "sdist bdist_wheel"
cleanup: "true"
edge: "true"
after_deploy:
- bash scripts/post-deploy.sh

- name: Build Webhook
stage: webhooks
language: python
python: "3.8.5"
arch: amd64
os: linux
install: pip install requests
script: python scripts/build_succeeded_webhook.py


after_failure:
- ${PYTHON_COMMAND-python} -m pip install requests
- ${PYTHON_COMMAND-python} scripts/job_failed_webhook.py
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
# Hikari contribution guidelines

First off, we would like to thank you for taking the time to help improve Hikari, it's greatly appreciated. We have some contribution guidelines that you should follow to ensure that your contribution is at it's best.

# Branches

We would like to keep consistency in how branches are named.

**This should be followed to ensure no issues when specific jobs run.**
**Your merge request could be closed if a developer/maintainer think it's risky due to pipelines failing.**

To push branches directly to the remote, you will have to name them like this:
- `task/issue-number-small-info-on-branch`
- This should be the default for any commit that doesnt fall in any of the cases under.
- `feature/issue-number-small-info-on-branch`
- This should be used for branches that require more tasks to merge into before going as one MR into `development`.
- `bugfix/issue-number-small-info-on-branch`
- This should be used for bugfixes.

`issue-number` is optional (only use if issue exists) and can be left out. `small-info-on-branch` should be replaced with a small description of the branch.

# Nox

We have nox to help out with running pipelines locally and provides some helpfull functionality.

You can check all the available nox commands by running `nox -l`.

Before commiting we recomend you to run `nox` to run all important pipelines and make sure the pipelines wont fail.

# Pipelines

We have several jobs to ensure that the code is at its best that in can be.

This includes:
- `install`
- Test installation.
- `flake8`
- Linting.
- `mypy`
- Type checking.
- `safety`
- Vulnerability checking.
- `twemoji-mapping`
- Force test all discord emojis (will only run when a file regarding emojis has been changed).
- `pdoc3`
- Generate documentation.
- `pages`
- Generate final documentation.
- `deploy`
- Deployment to pypi (will only run on `staging` and `master`).

All jobs will need to succeed before anything gets merged.

# Code of Conduct

## Our Pledge
Expand Down
Loading

0 comments on commit e0ed04f

Please sign in to comment.