Skip to content

Commit 83f5dfd

Browse files
authored
Merge pull request microsoft#20 from microsoft/dciborow/pyproject
Create pyproject.toml
2 parents b19380f + 03e4901 commit 83f5dfd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+713
-655
lines changed

.devcontainer/Dockerfile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bi
1313
&& rm -rf /tmp/conda-tmp
1414

1515
RUN conda install -y python=3.8 \
16-
&& python3.8 -m pip install --upgrade pip tox
17-
18-
COPY requirements.test.txt /tmp/
19-
RUN python3.8 -m pip install -r /tmp/requirements.test.txt
16+
&& python3.8 -m pip install --upgrade pip \
17+
&& python3.8 -m pip install \
18+
pytest \
19+
pytest-cov \
20+
flit \
21+
pre-commit
2022

21-
COPY requirements.txt /tmp/
22-
RUN python3.8 -m pip install -r /tmp/requirements.txt
23-
24-
# [Optional] Uncomment this section to install additional OS packages.
25-
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
26-
# && apt-get -y install --no-install-recommends <your-package-list-here>
23+
COPY .pre-commit-config.yaml .
24+
RUN git init . && pre-commit install-hooks

.devcontainer/devcontainer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
33
{
44
"name": "Miniconda (Python 3)",
5-
"build": {
5+
"build": {
66
"context": "..",
77
"dockerfile": "Dockerfile",
88
"args": {
99
"NODE_VERSION": "none"
1010
}
1111
},
12-
1312
// Set *default* container specific settings.json values on container create.
14-
"settings": {
13+
"settings": {
1514
"python.defaultInterpreterPath": "/opt/conda/bin/python",
1615
"python.linting.enabled": true,
1716
"python.linting.pylintEnabled": true,
@@ -25,19 +24,20 @@
2524
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
2625
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
2726
},
28-
2927
// Add the IDs of extensions you want installed when the container is created.
3028
"extensions": [
3129
"ms-python.python",
32-
"ms-python.vscode-pylance"
30+
"ms-python.vscode-pylance",
31+
"ms-python.pylint",
32+
"ms-python.black-formatter",
33+
"ms-vsliveshare.vsliveshare",
34+
"ryanluker.vscode-coverage-gutters",
35+
"bungcip.better-toml"
3336
],
34-
3537
// Use 'forwardPorts' to make a list of ports inside the container available locally.
3638
// "forwardPorts": [],
37-
3839
// Use 'postCreateCommand' to run commands after the container is created.
3940
// "postCreateCommand": "python --version",
40-
4141
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
4242
"remoteUser": "vscode",
4343
"features": {

.devcontainer/noop.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
This file is copied into the container along with environment.yml* from the
2-
parent folder. This is done to prevent the Dockerfile COPY instruction from
2+
parent folder. This is done to prevent the Dockerfile COPY instruction from
33
failing if no environment.yml is found.

.flake8

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[flake8]
2+
max-line-length = 120
3+
select = "F,E,W,B,B901,B902,B903"
4+
exclude = [
5+
".eggs",
6+
".git",
7+
".tox",
8+
"nssm",
9+
"obj",
10+
"out",
11+
"packages",
12+
"pywin32",
13+
"tests",
14+
"swagger_client"
15+
]
16+
ignore = "E722,B001,W503,E203"

.github/workflows/CI.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Python CI
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
release:
8+
types: [created]
9+
workflow_dispatch:
10+
11+
jobs:
12+
tooling:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
tools: ['black', 'bandit', 'pylint', 'pyright', 'flake8']
17+
include:
18+
- tools: pytest
19+
args: -m not integration and not gpu
20+
- tools: pytest
21+
args: -m integration
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: ${{ matrix.tools }}
25+
uses: dciborow/pyaction@0.0.28
26+
with:
27+
${{ matrix.tools }}: true
28+
args: ${{ matrix.args }}
29+
30+
publish:
31+
uses: ./.github/workflows/publish.yml

.github/workflows/black.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/mypy.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Python Publish Workflow
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- if: ${{ github.event_name == 'release' && secrets.PYPI_PASSWORD != '' }}
12+
name: Publish Release to PyPi
13+
uses: dciborow/pyaction@0.0.28
14+
with:
15+
pypi_publish: true
16+
pypi_password: ${{ secrets.PYPI_PASSWORD }}
17+
18+
- if: ${{ github.event_name == 'push' && secrets.PYPI_PASSWORD != '' }}
19+
name: Publish RC to PyPi
20+
uses: dciborow/pyaction@0.0.28
21+
with:
22+
pypi_publish: true
23+
pypi_password: ${{ secrets.PYPI_PASSWORD }}
24+
version_suffix: -rc${{ github.run_number }}-post${{ github.run_attempt }}
25+
26+
- if: ${{ github.event_name == 'pull_request' && secrets.TEST_PYPI_PASSWORD != '' }}
27+
name: Publish Snapshot to TestPyPi
28+
uses: dciborow/pyaction@0.0.28
29+
with:
30+
pypi_publish: true
31+
pypi_password: ${{ secrets.TEST_PYPI_PASSWORD }}
32+
pypi_repo: testpypi
33+
version_suffix: -post${{ github.run_number }}-dev${{ github.run_attempt }}

.github/workflows/pylint.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)