Skip to content

Commit

Permalink
Add prettier pre-commit (#1007)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
flying-sheep and pre-commit-ci[bot] authored Jun 15, 2023
1 parent 5c3d80a commit d346beb
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 220 deletions.
191 changes: 95 additions & 96 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,104 +1,103 @@
trigger:
- main
- main

variables:
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
RUN_COVERAGE: no
PRERELEASE_DEPENDENCIES: no

jobs:
- job: PyTest
pool:
vmImage: 'ubuntu-22.04'
strategy:
matrix:
Python310:
python.version: '3.10'
RUN_COVERAGE: yes
Python38:
python.version: '3.8'
PreRelease:
python.version: '3.10'
PRERELEASE_DEPENDENCIES: yes
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'

- task: Cache@2
inputs:
key: '"python $(python.version)" | "$(Agent.OS)" | pyproject.toml'
restoreKeys: |
python | "$(Agent.OS)"
python
path: $(PIP_CACHE_DIR)
displayName: Cache pip packages

- script: |
python -m pip install --upgrade pip
pip install pytest-cov wheel
pip install .[dev,test]
displayName: 'Install dependencies'
condition: eq(variables['PRERELEASE_DEPENDENCIES'], 'no')
- script: |
python -m pip install --pre --upgrade pip
pip install --pre pytest-cov wheel
pip install --pre .[dev,test]
displayName: 'Install dependencies release candidates'
condition: eq(variables['PRERELEASE_DEPENDENCIES'], 'yes')
- script: |
pip list
displayName: 'Display installed versions'
- script: |
pytest --color=yes --junitxml=junit/test-results.xml
displayName: 'PyTest'
condition: eq(variables['RUN_COVERAGE'], 'no')
- script: |
pytest --color=yes --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-context=test
displayName: 'PyTest (coverage)'
condition: eq(variables['RUN_COVERAGE'], 'yes')
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['RUN_COVERAGE'], 'yes')

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: 'junit/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'

- script: bash <(curl -s https://codecov.io/bash)
displayName: 'Upload to codecov.io'
condition: eq(variables['RUN_COVERAGE'], 'yes')

- job: CheckBuild
pool:
vmImage: 'ubuntu-22.04'
steps:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
displayName: 'Use Python 3.10'

- script: |
python -m pip install --upgrade pip
pip install build twine
displayName: 'Install build tools and requirements'
- script: pip list
displayName: 'Display installed versions'

- script: |
python -m build --sdist --wheel .
twine check dist/*
displayName: 'Build & Twine check'
- job: PyTest
pool:
vmImage: "ubuntu-22.04"
strategy:
matrix:
Python310:
python.version: "3.10"
RUN_COVERAGE: yes
Python38:
python.version: "3.8"
PreRelease:
python.version: "3.10"
PRERELEASE_DEPENDENCIES: yes
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
displayName: "Use Python $(python.version)"

- task: Cache@2
inputs:
key: '"python $(python.version)" | "$(Agent.OS)" | pyproject.toml'
restoreKeys: |
python | "$(Agent.OS)"
python
path: $(PIP_CACHE_DIR)
displayName: Cache pip packages

- script: |
python -m pip install --upgrade pip
pip install pytest-cov wheel
pip install .[dev,test]
displayName: "Install dependencies"
condition: eq(variables['PRERELEASE_DEPENDENCIES'], 'no')
- script: |
python -m pip install --pre --upgrade pip
pip install --pre pytest-cov wheel
pip install --pre .[dev,test]
displayName: "Install dependencies release candidates"
condition: eq(variables['PRERELEASE_DEPENDENCIES'], 'yes')
- script: |
pip list
displayName: "Display installed versions"
- script: |
pytest --color=yes --junitxml=junit/test-results.xml
displayName: "PyTest"
condition: eq(variables['RUN_COVERAGE'], 'no')
- script: |
pytest --color=yes --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-context=test
displayName: "PyTest (coverage)"
condition: eq(variables['RUN_COVERAGE'], 'yes')
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage.xml"
reportDirectory: "$(System.DefaultWorkingDirectory)/**/htmlcov"
condition: eq(variables['RUN_COVERAGE'], 'yes')

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: "junit/test-*.xml"
testRunTitle: "Publish test results for Python $(python.version)"

- script: bash <(curl -s https://codecov.io/bash)
displayName: "Upload to codecov.io"
condition: eq(variables['RUN_COVERAGE'], 'yes')

- job: CheckBuild
pool:
vmImage: "ubuntu-22.04"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "3.10"
displayName: "Use Python 3.10"

- script: |
python -m pip install --upgrade pip
pip install build twine
displayName: "Install build tools and requirements"
- script: pip list
displayName: "Display installed versions"

- script: |
python -m build --sdist --wheel .
twine check dist/*
displayName: "Build & Twine check"
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 88

[*.py]
indent_size = 4
indent_style = space

[*.{yml,yaml}]
indent_size = 2
indent_style = space
88 changes: 44 additions & 44 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
name: Bug report
description: anndata doesn’t do what it should? Please help us fix it!
#title: ...
labels: ['Bug 🐛']
labels: ["Bug 🐛"]
#assignees: []
body:
- type: checkboxes
id: terms
attributes:
label: Please make sure these conditions are met
# description: ...
options:
- label: I have checked that this issue has not already been reported.
required: true
- label: I have confirmed this bug exists on the latest version of anndata.
required: true
- label: (optional) I have confirmed this bug exists on the master branch of anndata.
required: false
- type: markdown
attributes:
value: |
**Note**: Please read [this guide][] detailing how to provide the necessary information for us to reproduce your bug.
- type: checkboxes
id: terms
attributes:
label: Please make sure these conditions are met
# description: ...
options:
- label: I have checked that this issue has not already been reported.
required: true
- label: I have confirmed this bug exists on the latest version of anndata.
required: true
- label: (optional) I have confirmed this bug exists on the master branch of anndata.
required: false
- type: markdown
attributes:
value: |
**Note**: Please read [this guide][] detailing how to provide the necessary information for us to reproduce your bug.
[this guide]: https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
- type: textarea
id: Report
attributes:
label: Report
description: |
Describe the bug you encountered, and what you were trying to do. Please use [github markdown][] features for readability.
[this guide]: https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports
- type: textarea
id: Report
attributes:
label: Report
description: |
Describe the bug you encountered, and what you were trying to do. Please use [github markdown][] features for readability.
[github markdown]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
value: |
Code:
[github markdown]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
value: |
Code:
```python
```python
```
```
Traceback:
Traceback:
```pytb
```pytb
```
validations:
required: true
- type: textarea
id: versions
attributes:
label: Versions
description: Which version of anndata and other related software you used. Please install and use `session-info`
render: python
value: |
>>> import anndata, session_info; session_info.show()
validations:
required: true
```
validations:
required: true
- type: textarea
id: versions
attributes:
label: Versions
description: Which version of anndata and other related software you used. Please install and use `session-info`
render: python
value: |
>>> import anndata, session_info; session_info.show()
validations:
required: true
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/enhancement-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ description: Anything you’d like to see in anndata?
labels: [enhancement]
#assignees: []
body:
- type: textarea
id: description
attributes:
label: |
Please describe your wishes and possible alternatives to achieve the desired result.
validations:
required: true
- type: textarea
id: description
attributes:
label: |
Please describe your wishes and possible alternatives to achieve the desired result.
validations:
required: true
Loading

0 comments on commit d346beb

Please sign in to comment.