Skip to content

Commit 515a0e6

Browse files
authored
Merge pull request Azure-Samples#1 from Azure-Samples/initial-upload
Initial upload
2 parents 797b693 + a465f05 commit 515a0e6

Some content is hidden

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

63 files changed

+1677
-42
lines changed

.devcontainer/Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM ubuntu:21.04
2+
3+
ARG USERNAME=alex
4+
ARG USER_UID=1000
5+
ARG USER_GID=$USER_UID
6+
7+
# Create the user
8+
RUN groupadd --gid $USER_GID $USERNAME \
9+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
10+
11+
# Update packages list & install missing packages
12+
RUN apt-get update \
13+
&& export DEBIAN_FRONTEND=noninteractive \
14+
# install missing packages
15+
&& apt-get install -y sudo git curl wget make procps \
16+
python3-pip unzip nodejs npm vim dos2unix apt-transport-https ca-certificates \
17+
gnupg lsb-release
18+
19+
# Finish setting up $USERNAME (sudo, no password etc ...)
20+
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
21+
&& chmod 0440 /etc/sudoers.d/$USERNAME
22+
23+
# Install Docker CLI
24+
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
25+
26+
RUN echo \
27+
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
28+
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
29+
30+
RUN apt-get update \
31+
&& apt-get install -y docker-ce-cli
32+
33+
# Python things: update pip
34+
RUN python3 -m pip install pip --upgrade
35+
36+
# Install required librairies
37+
COPY ./requirements.txt /home/$USERNAME/
38+
39+
RUN pip install -r /home/$USERNAME/requirements.txt
40+
41+
# Set $USERNAME as default user
42+
USER $USERNAME
43+
44+
# Add custom bashrc
45+
COPY --chown=$USERNAME:$USERNAME ./bashrc /home/$USERNAME/.bashrc_extension
46+
RUN echo "source ~/.bashrc_extension" >> ~/.bashrc && dos2unix ~/.bashrc_extension
47+
48+
# Back to default shell
49+
SHELL ["/bin/bash", "-c"]
50+
51+
CMD [ "sleep", "infinity" ]

.devcontainer/bashrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Add autocompletion to make targets (so that one can input > make [tab])
2+
complete -W "`grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' /workspace/?akefile | sed 's/[^a-zA-Z0-9_.-]*$//'`" make
3+
4+
# Add autocompletion to git commands
5+
source /usr/share/bash-completion/completions/git
6+
7+
# Add aliases
8+
alias ll='ls -halp'
9+
10+
# Add .local/bin to PATH (Python libraries)
11+
export PATH="$HOME/.local/bin:$PATH"
12+
13+
# Set permissions on docker.sock for docker cli in docker
14+
if [ -e /var/run/docker.sock ]; then
15+
sudo chown alex:alex /var/run/docker.sock;
16+
fi

.devcontainer/devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* devcontainer.json files support JSON with Comments (jsonc)! */
2+
3+
{
4+
"name": "flask-reactize",
5+
"dockerComposeFile": "docker-compose.yml",
6+
"service": "workspace-flask-reactize",
7+
"context": ".",
8+
"workspaceFolder": "/workspace",
9+
// Install ESLint and Peacock extensions
10+
"extensions": [
11+
"ms-python.python",
12+
"ms-python.vscode-pylance",
13+
"ms-azuretools.vscode-docker",
14+
"irongeek.vscode-env"
15+
],
16+
"settings": {
17+
"python.pythonPath": "/usr/bin/python3",
18+
"python.envFile": "${workspaceFolder}/python-path.env",
19+
"python.formatting.provider": "black",
20+
"python.testing.nosetestsEnabled": false,
21+
"python.testing.pytestEnabled": true
22+
},
23+
"mounts": [
24+
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
25+
],
26+
"runArgs": [
27+
"--init"
28+
]
29+
}

.devcontainer/docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3'
2+
services:
3+
workspace-flask-reactize:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
volumes:
8+
- "..:/workspace"
9+
- "~/.ssh:/home/alex/.ssh"
10+
- "/var/run/docker.sock:/var/run/docker.sock"
11+
ports:
12+
- "127.0.0.1:8888:8888"
13+
command: sleep infinity

.devcontainer/requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
setuptools==59.4.0
2+
wheel==0.37.0
3+
pytest==6.2.5
4+
pytest-cov==3.0.0
5+
twine
6+
requests-mock==1.9.3
7+
black==21.11b1
8+
flake8==4.0.1
9+
isort==5.10.1

.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
# Recommend matching the black line length (default 88),
3+
# rather than using the flake8 default of 79:
4+
max-line-length = 128
5+
exclude =
6+
.git,
7+
__pycache__,
8+
build,
9+
dist,
10+
extend-ignore =
11+
# See https://github.com/PyCQA/pycodestyle/issues/373
12+
E203,

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
### Developer ###
2+
.vscode/
3+
.idea/
4+
local.env
5+
.env
6+
.DS_Store
7+
.deployment
8+
9+
# a developer can copy his/her own files in a me/ folder without having them in git
10+
**/me/
11+
12+
13+
### Python ###
14+
# Byte-compiled / optimized / DLL files
15+
__pycache__/
16+
*.whl
17+
*.py[cod]
18+
*$py.class
19+
20+
# C extensions
21+
*.so
22+
23+
# Distribution / packaging
24+
.Python
25+
build/
26+
develop-eggs/
27+
dist/
28+
downloads/
29+
eggs/
30+
.eggs/
31+
parts/
32+
sdist/
33+
var/
34+
wheels/
35+
pip-wheel-metadata/
36+
share/python-wheels/
37+
*.egg-info/
38+
.installed.cfg
39+
*.egg
40+
MANIFEST
41+
42+
# PyTest
43+
.pytest_cache/
44+
.coverage
45+
coverage.xml
46+
pytest-results.xml
47+
pytest-integration-results.xml
48+
pytest-e2e-results.xml
49+
50+
# flask session folder
51+
flask_session/
52+
tests-report.md
53+
54+
55+
### reactjs ###
56+
node_modules/
57+
package-lock.json
58+
59+
.pypirc

.isort.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[settings]
2+
profile = black
3+
multi_line_output = 3
4+
src_paths = ./src/*/src

CHANGELOG.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
## [project-title] Changelog
1+
## flask-reactize changelog
22

3-
<a name="x.y.z"></a>
4-
# x.y.z (yyyy-mm-dd)
3+
<a name="1.0.0"></a>
4+
# 1.0.0
55

6-
*Features*
7-
* ...
6+
* Final version.
7+
* Update package description file & repository URL.
88

9-
*Bug Fixes*
10-
* ...
9+
<a name="1.0.0a3"></a>
10+
# 1.0.0a3
1111

12-
*Breaking Changes*
13-
* ...
12+
initial version

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to [project-title]
1+
# Contributing to flask-reactize
22

33
This project welcomes contributions and suggestions. Most contributions require you to agree to a
44
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us

0 commit comments

Comments
 (0)