Skip to content

Commit fc00e81

Browse files
dciborowdciborowlaserprecgithub-actions[bot]
authored
Flatten Main (microsoft#40)
* chore(template): merge template changes 🆙 * Update pypi-test-publish.yml * Update pypi-publish.yml * Update template-sync.yml * Update pyright.yml * Update pylint.yml * Update mypy.yml * Update main.yml * Update pyright.yml * Create Dockerfile * Create add-notice.sh * Create devcontainer.json * Create noop.txt * Update requirements.test.txt * Update ws.code-workspace * Create conftest.py * Delete conftest.py * Update setup.py * Update tox.ini Bring in tox.ini from `Microsoft/recommenders` repo * Create pyproject.toml Update pypi-test-publish.yml Update pypi-publish.yml Delete black.toml Update pyproject.toml Update pyproject.toml Update tox.ini Update tox.ini Update pyproject.toml Update black.yml Update black.yml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update black.yml rename python project dir with underscore Update tests/test_methods.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> formatting Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Delete mypy.yml Update pyproject.toml Update pyproject.toml Update pyright.yml Update pytest.yml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update pyproject.toml Update __init__.py Update ai_python_package/__init__.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Steve Dower <steve.dower@microsoft.com> Co-authored-by: Brett Cannon <brett@python.org> Update .github/workflows/black.yml Delete tox.ini Update pyproject.toml Update pyproject.toml Update pypi-publish.yml Update pytest.yml Create bandit.yml Rename main.yml to wemake-python-styleguide.yml Update pyproject.toml Co-authored-by: Steve Dower <steve.dower@microsoft.com> create source directory Update pyproject.toml Update pyproject.toml cleanup Update pyright.yml Update pyright.yml Update pytest.yml Update pytest.yml Update bandit.yml Update bandit.yml Update black.yml Update pylint.yml Update pyproject.toml Update pyproject.toml Update pytest.yml Update __init__.py Update pytest.yml Update bandit.yml Update bandit.yml Update black.yml Update pylint.yml Update pyright.yml Update pytest.yml Update bandit.yml Update black.yml Update pylint.yml Update pyright.yml Update pytest.yml Update pypi-publish.yml Update pypi-test-publish.yml Update pypi-test-publish.yml Update and rename pypi-publish.yml to twine.yml Update pypi-test-publish.yml Rename pypi-test-publish.yml to twine-test.yml Update pyright.yml Update pyright.yml Update wemake-python-styleguide.yml Update bandit.yml Update black.yml Create pull-request.yml Update pylint.yml Update pyright.yml Update pytest.yml Update pull-request.yml Update pull-request.yml Update pull-request.yml Update pull-request.yml Update pyproject.toml Update pull-request.yml Update pull-request.yml Delete bandit.yml Update pull-request.yml Update pull-request.yml Delete pylint.yml Delete pyright.yml Delete pytest.yml Delete wemake-python-styleguide.yml Apply suggestions from code review Update pull-request.yml Update pull-request.yml Update pull-request.yml Update pull-request.yml Create .pre-commit-config.yaml Update .pre-commit-config.yaml Create noxfile.py Create nox.yml Update requirements.test.txt * Update noxfile.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update noxfile.py * Update noxfile.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Delete nox.yml * Delete noxfile.py * Update pyproject.toml * Update pyproject.toml * Update pyproject.toml * Update pull-request.yml * Update and rename twine.yml to publish.yml * Update pyproject.toml * Update pyproject.toml * Update pyproject.toml * Update hello_world.py * Update hello_world.py * Update test_methods.py * Update hello_world.py * Update hello_world.py * Update src/ai_python_package/hello_world.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/ai_python_package/hello_world.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update hello_world.py * Update src/ai_python_package/hello_world.py Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update src/ai_python_package/hello_world.py * Update .pre-commit-config.yaml * Update pull-request.yml * Update pull-request.yml * Update requirements.test.txt * cleanup tox * Update .pre-commit-config.yaml * Update pyproject.toml * Create .flake8 * Delete requirements.txt * Delete requirements.test.txt * Update pyproject.toml * Update pyproject.toml * Rename twine-test.yml to publish-test.yml * Update publish.yml * Create proto-pr.yml * move pylint configs into pyproject.toml * Delete proto-pr.yml * Apply suggestions from code review * Apply suggestions from code review * Update pyproject.toml * Create conftest.py * Update test_methods.py * Update conftest.py * Update test_methods.py * Update conftest.py * Update test_methods.py * Update test_methods.py * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update README.md * Update Dockerfile * Update Dockerfile * Delete MANIFEST.in * Update Dockerfile * adding python configs for codespace * Update Dockerfile * Update Dockerfile * fix workspace configurations * update sys path to include src directory for pytest * remove preinstalled from recommendations * remove dup * fix pylance issues * drop ai prefix * reformat * precommit hooks * setup pre-commit in container * enable code coverage * add toml extension * add toml extension * move coverage configuration to pyproject.toml * fix duplication * Create pull-request-2.yml * Update pull-request-2.yml * Update pull-request-2.yml * Update .github/workflows/pull-request-2.yml * Update pull-request-2.yml * Update pull-request-2.yml * Update pull-request-2.yml * Update pull-request-2.yml * Update pull-request-2.yml * Update pull-request-2.yml * Delete pull-request.yml * Rename pull-request-2.yml to pull-request.yml * add requirements installation to docker * cut reqs install attempt * Delete black.yml * Update pull-request.yml * Update Dockerfile * Update pull-request.yml * Update pull-request.yml * Update publish.yml * Update pull-request.yml * Update pull-request.yml * Delete publish.yml * Update pull-request.yml * Update pull-request.yml * Delete publish-test.yml * Rename pull-request.yml to CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update .vscode/extensions.json * Update CI.yml * Update CI.yml * Update pyproject.toml * Update CI.yml * Update CI.yml * Update CI.yml * Create .pypirc * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update README.md * Update CI.yml * Create workflows.md * Create devcontainer.md * Create developer.md * Create vscode.md * Create pyproject.md * Create pre-commit-config.md * Update CI.yml * Update pyproject.toml * Update pyproject.toml * Update pyproject.toml * Update pyproject.toml * Apply suggestions from code review * Update CI.yml * Update __init__.py * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update pyproject.toml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update CI.yml * Create publish.yml * Update CI.yml * Update CI.yml * Update CI.yml * Update publish.yml * Update CI.yml * Update publish.yml * Revert "Create pyproject.toml" * Revert "Revert "Create pyproject.toml"" * Update pyproject.toml * Update CI.yml * Update test_methods.py * Update tests/test_methods.py * Update devcontainer.json * Delete ws.code-workspace * Update template-sync.yml * Delete .templateversionrc * Create template-sync.yml * Create README.md * Update template-sync.yml * Update pyproject.toml * Update CI.yml (microsoft#38) * Update CI.yml Update Python Action to version 0.0.29 * Update CI.yml * Update CI.yml (microsoft#39) * Update CI.yml * Update CI.yml * Update publish.yml Co-authored-by: dciborow <github-action@actions-template-sync.noreply.github.com> Co-authored-by: Jianjie Liu <liujianji3@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 485c3a3 commit fc00e81

47 files changed

Lines changed: 798 additions & 723 deletions

Some content is hidden

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

‎.devcontainer/Dockerfile‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda/.devcontainer/base.Dockerfile
2+
3+
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3
4+
5+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
6+
ARG NODE_VERSION="none"
7+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
8+
9+
# Copy environment.yml (if found) to a temp location so we update the environment. Also
10+
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
11+
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
12+
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
13+
&& rm -rf /tmp/conda-tmp
14+
15+
RUN conda install -y python=3.8 \
16+
&& python3.8 -m pip install --upgrade pip \
17+
&& python3.8 -m pip install \
18+
pytest \
19+
pytest-cov \
20+
flit \
21+
pre-commit
22+
23+
COPY .pre-commit-config.yaml .
24+
RUN git init . && pre-commit install-hooks

‎.devcontainer/add-notice.sh‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Display a notice when not running in GitHub Codespaces
2+
3+
cat << 'EOF' > /usr/local/etc/vscode-dev-containers/conda-notice.txt
4+
When using "conda" from outside of GitHub Codespaces, note the Anaconda repository
5+
contains restrictions on commercial use that may impact certain organizations. See
6+
https://aka.ms/vscode-remote/conda/miniconda
7+
8+
EOF
9+
10+
notice_script="$(cat << 'EOF'
11+
if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
12+
cat "/usr/local/etc/vscode-dev-containers/conda-notice.txt"
13+
mkdir -p "$HOME/.config/vscode-dev-containers"
14+
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &)
15+
fi
16+
EOF
17+
)"
18+
19+
echo "${notice_script}" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc

‎.devcontainer/devcontainer.json‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
3+
{
4+
"name": "Miniconda (Python 3)",
5+
"build": {
6+
"context": "..",
7+
"dockerfile": "Dockerfile",
8+
"args": {
9+
"NODE_VERSION": "none"
10+
}
11+
},
12+
// Set *default* container specific settings.json values on container create.
13+
"settings": {
14+
"editor.trimAutoWhitespace": true,
15+
"editor.formatOnSave": true,
16+
"editor.formatOnPaste": true,
17+
"files.trimTrailingWhitespace": true,
18+
"files.autoSave": "onFocusChange",
19+
"python.analysis.typeCheckingMode": "strict",
20+
"python.defaultInterpreterPath": "/opt/conda/bin/python",
21+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
22+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
23+
"python.formatting.blackArgs": [
24+
"--config",
25+
"pyproject.toml"
26+
],
27+
"python.formatting.provider": "black",
28+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
29+
"python.linting.enabled": true,
30+
"python.linting.lintOnSave": true,
31+
"python.linting.banditArgs": [
32+
"--configfile",
33+
"pyproject.toml"
34+
],
35+
"python.linting.banditEnabled": true,
36+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
37+
"python.linting.flake8Args": [
38+
"--config",
39+
".flake8"
40+
],
41+
"python.linting.flake8Enabled": true,
42+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
43+
"python.linting.mypyEnabled": true,
44+
"python.linting.mypyArgs": [
45+
"--config-file",
46+
".pyproject.toml"
47+
],
48+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
49+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
50+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
51+
"python.linting.pylintEnabled": true,
52+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
53+
},
54+
// Add the IDs of extensions you want installed when the container is created.
55+
"extensions": [
56+
"ms-python.python",
57+
"ms-python.vscode-pylance",
58+
"ms-python.pylint",
59+
"ms-python.black-formatter",
60+
"ms-vsliveshare.vsliveshare",
61+
"ryanluker.vscode-coverage-gutters",
62+
"bungcip.better-toml"
63+
],
64+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
65+
// "forwardPorts": [],
66+
// Use 'postCreateCommand' to run commands after the container is created.
67+
// "postCreateCommand": "python --version",
68+
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
69+
"remoteUser": "vscode",
70+
"features": {
71+
"azure-cli": "latest"
72+
}
73+
}

‎.devcontainer/noop.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
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
3+
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/template-sync.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
dependents:
2+
- "az-gamedev-spark"
3+
4+
files:
5+
- ".gitignore" # include
6+
- ".github"
7+
- ".vscode"
8+
- "tests/conftest.py"
9+
- ".flake8"
10+
- ".pre-commit-config.yml"
11+
- ".pypirc"
12+
- "docs"
13+
- "src/README.md"
14+
- "CODE_OF_CONDUCT.md"
15+
- "LICENSE"
16+
- "README.md"
17+
- "SECURITY.md"
18+
- "SUPPORT.md"
19+
- "pyproject.toml"
20+
21+
- "!.github/workflows/template-sync.yml"
22+
- "!.github/template-sync.yml"
23+
- "!src/python_project"
24+
- "!tests/test_methods.py"

‎.github/workflows/CI.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
validation:
13+
uses: microsoft/action-python/.github/workflows/validation.yml@0.2.0
14+
15+
publish:
16+
uses: microsoft/action-python/.github/workflows/publish.yml@0.2.0
17+
secrets:
18+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
19+
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}

‎.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.

0 commit comments

Comments
 (0)