Skip to content

Commit

Permalink
Merge pull request #8 from vroncevic/dev
Browse files Browse the repository at this point in the history
[gen_shared_file] initial project infrastructure
  • Loading branch information
vroncevic committed Jul 2, 2021
2 parents 614e551 + 3f32216 commit 8c6662b
Show file tree
Hide file tree
Showing 36 changed files with 428 additions and 290 deletions.
File renamed without changes.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/gen_shared_file_bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Bug report
about: Create a report to help us improve
title: "[gen_shared_file]"
labels: bug
assignees: vroncevic

---


10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/gen_shared_file_feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[gen_shared_file]"
labels: enhancement
assignees: vroncevic

---


20 changes: 20 additions & 0 deletions .github/workflows/gen_shared_file_docker_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: gen_shared_file docker checker
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker image
id: docker_checker
run: |
echo Building Docker image
build_transcript=$(docker build . --file Dockerfile --tag gen_shared_file:latest)
[[ "$build_transcript" == *"Successfully"* ]] && echo ::set-output name=status::success || echo ::set-output name=status::failure
- name: Check on failures
if: steps.docker_checker.outputs.status == 'failure'
run: exit 1
12 changes: 2 additions & 10 deletions .github/workflows/gen_shared_file_package.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
name: Python package gen_shared_file

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide ===> strict 79
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics
30 changes: 30 additions & 0 deletions .github/workflows/gen_shared_file_py_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: gen_shared_file py checker
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check length of line in modules
id: long_line_checker
run: |
echo Checking length of line in modules
modules_ok=0
modules=($(find gen_shared_file/ -type f -name '*.py' -exec echo '{}' \;))
for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); [[ $line_length -gt 80 ]] && modules_ok=1; done
[[ $modules_ok -eq 0 ]] && echo ::set-output name=status::success || echo ::set-output name=status::failure
- name: Check number of lines in modules
id: num_line_checker
run: |
echo Checking number of lines in modules
modules_ok=0
modules=($(find gen_shared_file/ -type f -name '*.py' -exec echo '{}' \;))
for mod in "${modules[@]}"; do line_numbers=$(wc -l < "${mod}"); [[ $line_numbers -gt 300 ]] && modules_ok=1; done
[[ $modules_ok -eq 0 ]] && echo ::set-output name=status::success || echo ::set-output name=status::failure
- name: Check on failures
if: steps.long_line_checker.outputs.status == 'failure' || steps.num_line_checker.outputs.status == 'failure'
run: exit 1
23 changes: 23 additions & 0 deletions .github/workflows/gen_shared_file_python2_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Install Python2 Package gen_shared_file
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '2.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements.txt
- name: Build and publish
run: |
python setup.py --github sdist bdist_wheel
23 changes: 23 additions & 0 deletions .github/workflows/gen_shared_file_python3_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Install Python3 Package gen_shared_file
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install -r requirements.txt
- name: Build and publish
run: |
python setup.py --github sdist bdist_wheel
8 changes: 8 additions & 0 deletions .github/workflows/gen_shared_file_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: TOC Generator gen_shared_file
on: push
jobs:
generateTOC:
name: TOC Generator
runs-on: ubuntu-latest
steps:
- uses: technote-space/toc-generator@v2
16 changes: 16 additions & 0 deletions .github/workflows/gen_shared_file_triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Triage gen_shared_file
on:
issues:
types: [opened]
jobs:
commentOnNewIssues:
name: Comment On New Issues
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Comment On New Issues
uses: actions/github@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: comment "[gen_shared_file] should be supported for Python 2.7, 3.5, 3.6, 3.7, 3.8"
16 changes: 16 additions & 0 deletions .github/workflows/gen_shared_file_triage_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Triage gen_shared_file label
on:
issues:
types: [opened]
jobs:
applyTriageLabel:
name: Apply Triage Label
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Apply Triage Label
uses: actions/github@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: label triage
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__/
*.py[cod]
*$py.class
.idea/
.vscode/
8 changes: 8 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
python:
version: 2.7
install:
- requirements: requirements.txt
sphinx:
configuration: docs/source/conf.py
formats: all
49 changes: 49 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2020 Vladimir Roncevic <elektron.ronca@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

FROM debian:10
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -yq --no-install-recommends \
tree \
htop \
python \
python-pip \
python-wheel \
python3 \
python3-pip \
python3-wheel \
libyaml-dev

RUN pip install --upgrade setuptools
RUN pip3 install --upgrade setuptools
COPY requirements.txt /
RUN pip install -r requirements.txt
RUN pip3 install -r requirements.txt
RUN rm -f requirements.txt
RUN mkdir /gen_shared_file/
COPY gen_shared_file /gen_shared_file/
COPY setup.py /
COPY README.md /
RUN find /gen_shared_file/ -name "*.editorconfig" -type f -exec rm -Rf {} \;
RUN python setup.py install_lib
RUN python setup.py install_egg_info
RUN python setup.py install_data
RUN python3 setup.py install_lib
RUN python3 setup.py install_data
RUN python3 setup.py install_egg_info
RUN rm -rf /gen_shared_file/
RUN rm -f setup.py
RUN rm -f README.md
Empty file modified LICENSE
100644 → 100755
Empty file.

0 comments on commit 8c6662b

Please sign in to comment.