diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..c2a211c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,28 @@ +--- +name: Bug report +about: Report an error that you've encountered. +labels: 'bug' +--- +### Environment information + +* Python Version: x.x.x +* OS: osx/linux/win + +Python environment + +``` +$ pip freeze +# ...copy and paste result of above command here... +``` + +### What went wrong? + +Please include information like: + +* what command you ran +* the code that caused the failure (see [this link](https://help.github.com/articles/basic-writing-and-formatting-syntax/) for help with formatting code) +* full output of the error you received + +### How can it be fixed? + +Fill this in if you have ideas on how the bug could be fixed. diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000..742ce66 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,22 @@ +--- +name: Feature request +about: Request a new feature, or an improvement to existing functionality. +labels: 'enhancement' +--- + +### Overview + +Provide a simple overview of what you wish to see added. Please include: + +* What you are trying to do +* Why Ape's current functionality is inadequate to address your goal + +### Specification + +Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better! + +Remember, your feature is much more likely to be included if it does not involve any breaking changes. + +### Dependencies + +Include links to any open issues that must be resolved before this feature can be implemented. diff --git a/.github/ISSUE_TEMPLATE/work-item.md b/.github/ISSUE_TEMPLATE/work-item.md new file mode 100644 index 0000000..d5bb99c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/work-item.md @@ -0,0 +1,41 @@ +--- +name: Work item +about: New work item +labels: 'backlog' + +--- + +### Elevator pitch: + + +### Value: + + +### Dependencies: + + +### Design approach: + + +### Task list: + +* [ ] Tasks go here + +### Estimated completion date: + + +### Design review: + +Do not signoff unless: +- 1) agreed the tasks and design approach will achieve acceptance, and +- 2) the work can be completed by one person within the SLA. +Design reviewers should consider simpler approaches to achieve goals. + +(Please leave a comment to sign off) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..38bee12 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,14 @@ +### What I did + +Related issue: # + +### How I did it + +### How to verify it + +### Checklist + +- [ ] Passes all linting checks (pre-commit and CI jobs) +- [ ] New test cases have been added and are passing +- [ ] Documentation has been updated +- [ ] PR title follows [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) standard (will be automatically included in the changelog) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..70b2a3f --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,37 @@ +name-template: '$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' + +categories: + - title: 'Features' + labels: + - 'feat' + - title: 'Bug Fixes' + labels: + - 'fix' + - title: 'Other updates' + labels: + - 'refactor' + - 'chore' + - 'docs' + +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. + +version-resolver: + major: + labels: + - 'major' + minor: + labels: + - 'minor' + patch: + labels: + - 'patch' + default: patch + +template: | + ## Changes + + $CHANGES + + Special thanks to: $CONTRIBUTORS diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml new file mode 100644 index 0000000..c376171 --- /dev/null +++ b/.github/workflows/commitlint.yaml @@ -0,0 +1,25 @@ +on: push + +name: Commit Message + +# NOTE: Skip check on PR so as not to confuse contributors +# NOTE: Also install a PR title checker so we don't mess up merges +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install Dependencies + run: pip install .[dev] + + - name: Check commit history + run: cz check --rev-range $(git rev-list --all --reverse | head -1)..HEAD diff --git a/.github/workflows/draft.yaml b/.github/workflows/draft.yaml new file mode 100644 index 0000000..423582b --- /dev/null +++ b/.github/workflows/draft.yaml @@ -0,0 +1,17 @@ +name: Release Drafter + +on: + push: + branches: + - main + +jobs: + update-draft: + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "main" + - uses: release-drafter/release-drafter@v5 + with: + disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a9f72da..dd7865b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,11 +23,11 @@ jobs: - name: Run Black run: black --check . - - name: Run isort - run: isort --check-only --diff ./tokenlists ./tests ./setup.py - - name: Run flake8 - run: flake8 ./tokenlists ./tests ./setup.py + run: flake8 . + + - name: Run isort + run: isort --check-only . type-check: runs-on: ubuntu-latest @@ -41,16 +41,17 @@ jobs: python-version: 3.8 - name: Install Dependencies - run: pip install .[lint] + run: pip install .[lint,test] # Might need test deps - name: Run MyPy - run: mypy -p tokenlists + run: mypy . functional: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest, macos-latest] # eventually add `windows-latest` python-version: [3.6, 3.7, 3.8, 3.9] steps: @@ -65,7 +66,7 @@ jobs: run: pip install .[test] - name: Run Tests - run: pytest -m "not fuzzing" -s + run: pytest -m "not fuzzing" -n 0 -s --cov fuzzing: runs-on: ubuntu-latest diff --git a/.github/workflows/title.yaml b/.github/workflows/title.yaml new file mode 100644 index 0000000..d283678 --- /dev/null +++ b/.github/workflows/title.yaml @@ -0,0 +1,28 @@ +name: PR Title + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install Dependencies + run: pip install commitizen + + - name: Check PR Title + env: + TITLE: ${{ github.event.pull_request.title }} + run: cz check --message "$TITLE" diff --git a/.gitignore b/.gitignore index c4c3591..700eaf1 100644 --- a/.gitignore +++ b/.gitignore @@ -98,9 +98,6 @@ __pypackages__/ celerybeat-schedule celerybeat.pid -# SageMath parsed files -*.sage.py - # Environments .env .venv @@ -110,13 +107,6 @@ ENV/ env.bak/ venv.bak/ -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - # mkdocs documentation /site @@ -125,8 +115,5 @@ venv.bak/ .dmypy.json dmypy.json -# Pyre type checker -.pyre/ - # setuptools-scm version.py diff --git a/setup.py b/setup.py index 84ae970..7bd6bc8 100644 --- a/setup.py +++ b/setup.py @@ -25,12 +25,11 @@ ], "release": [ # `release` GitHub Action job uses this "setuptools", # Installation tool - "setuptools-scm", # Installation tool "wheel", # Packaging tool "twine", # Package upload tool ], "dev": [ - "commitizen", # Manage commits and publishing releases + "commitizen", # Manage commits and publishing releases, "pre-commit", # Ensure that linters are run prior to commiting "pytest-watch", # `ptw` test watcher/runner "IPython", # Console for interacting