Skip to content

Commit

Permalink
Flatten Main (#40)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Brett Cannon <[email protected]>

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 <[email protected]>

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 (#38)

* Update CI.yml

Update Python Action to version 0.0.29

* Update CI.yml

* Update CI.yml (#39)

* Update CI.yml

* Update CI.yml

* Update publish.yml

Co-authored-by: dciborow <[email protected]>
Co-authored-by: Jianjie Liu <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 10, 2022
1 parent 485c3a3 commit fc00e81
Show file tree
Hide file tree
Showing 47 changed files with 798 additions and 723 deletions.
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda/.devcontainer/base.Dockerfile

FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
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 \
&& rm -rf /tmp/conda-tmp

RUN conda install -y python=3.8 \
&& python3.8 -m pip install --upgrade pip \
&& python3.8 -m pip install \
pytest \
pytest-cov \
flit \
pre-commit

COPY .pre-commit-config.yaml .
RUN git init . && pre-commit install-hooks
19 changes: 19 additions & 0 deletions .devcontainer/add-notice.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Display a notice when not running in GitHub Codespaces

cat << 'EOF' > /usr/local/etc/vscode-dev-containers/conda-notice.txt
When using "conda" from outside of GitHub Codespaces, note the Anaconda repository
contains restrictions on commercial use that may impact certain organizations. See
https://aka.ms/vscode-remote/conda/miniconda
EOF

notice_script="$(cat << 'EOF'
if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
cat "/usr/local/etc/vscode-dev-containers/conda-notice.txt"
mkdir -p "$HOME/.config/vscode-dev-containers"
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &)
fi
EOF
)"

echo "${notice_script}" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc
73 changes: 73 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
{
"name": "Miniconda (Python 3)",
"build": {
"context": "..",
"dockerfile": "Dockerfile",
"args": {
"NODE_VERSION": "none"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"editor.trimAutoWhitespace": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"files.trimTrailingWhitespace": true,
"files.autoSave": "onFocusChange",
"python.analysis.typeCheckingMode": "strict",
"python.defaultInterpreterPath": "/opt/conda/bin/python",
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.blackArgs": [
"--config",
"pyproject.toml"
],
"python.formatting.provider": "black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.banditArgs": [
"--configfile",
"pyproject.toml"
],
"python.linting.banditEnabled": true,
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Args": [
"--config",
".flake8"
],
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyEnabled": true,
"python.linting.mypyArgs": [
"--config-file",
".pyproject.toml"
],
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintEnabled": true,
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.pylint",
"ms-python.black-formatter",
"ms-vsliveshare.vsliveshare",
"ryanluker.vscode-coverage-gutters",
"bungcip.better-toml"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "python --version",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"azure-cli": "latest"
}
}
3 changes: 3 additions & 0 deletions .devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file is copied into the container along with environment.yml* from the
parent folder. This is done to prevent the Dockerfile COPY instruction from
failing if no environment.yml is found.
16 changes: 16 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[flake8]
max-line-length = 120
select = "F,E,W,B,B901,B902,B903"
exclude = [
".eggs",
".git",
".tox",
"nssm",
"obj",
"out",
"packages",
"pywin32",
"tests",
"swagger_client"
]
ignore = "E722,B001,W503,E203"
24 changes: 24 additions & 0 deletions .github/template-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dependents:
- "az-gamedev-spark"

files:
- ".gitignore" # include
- ".github"
- ".vscode"
- "tests/conftest.py"
- ".flake8"
- ".pre-commit-config.yml"
- ".pypirc"
- "docs"
- "src/README.md"
- "CODE_OF_CONDUCT.md"
- "LICENSE"
- "README.md"
- "SECURITY.md"
- "SUPPORT.md"
- "pyproject.toml"

- "!.github/workflows/template-sync.yml"
- "!.github/template-sync.yml"
- "!src/python_project"
- "!tests/test_methods.py"
19 changes: 19 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Python CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
workflow_dispatch:

jobs:
validation:
uses: microsoft/action-python/.github/workflows/[email protected]

publish:
uses: microsoft/action-python/.github/workflows/[email protected]
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
31 changes: 0 additions & 31 deletions .github/workflows/black.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/main.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/mypy.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Python Publish Workflow
on:
workflow_call:

jobs:
publish:
uses: microsoft/action-python/.github/workflows/[email protected]
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
26 changes: 0 additions & 26 deletions .github/workflows/pylint.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/pypi-publish.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/pypi-test-publish.yml

This file was deleted.

Loading

0 comments on commit fc00e81

Please sign in to comment.