Skip to content

Commit

Permalink
Merge pull request #2 from rte-france/scl_loader_v2_dev
Browse files Browse the repository at this point in the history
Scl loader v2 dev
  • Loading branch information
Synx-FR authored Dec 3, 2020
2 parents 902e48f + bcc40d4 commit 7457e83
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 168 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/QA.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint and Test Python 🐍 distribution 📦

on: [push, workflow_dispatch]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: 🔬Lint with flake8 🔬
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./src/scl_loader/scl_loader.py --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ./src/scl_loader/scl_loader.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: ⚗️Test with pytest ⚗️
run: |
pip install pytest
pip install pytest-cov
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=scl_loader --cov-report=xml --cov-report=html
26 changes: 26 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pypi - Publish Python 🐍 distributions 📦

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 🐍
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build 🏭 and Publish 🚀 distribution 📦 to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TOKEN_PYPI }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
4 changes: 2 additions & 2 deletions .github/workflows/release_testpypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python 🐍 distributions 📦 to TestPyPI
name: TESTPypi - Publish Python 🐍 distribution 📦

on: workflow_dispatch

Expand All @@ -18,7 +18,7 @@ jobs:
- name: Build 🏭 and Publish 🚀 distribution 📦 to TestPyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TOKEN_PYPI }}
TWINE_PASSWORD: ${{ secrets.TOKEN_TESTPYPI }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ my_venv/
.idea/

data/
junit/
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
# Get the long description from the README file
with open(path.join(HERE, 'README.md'), encoding='utf-8') as f:
LONG_DESCRIPTION = f.read()

with open(path.join(HERE, 'requirements.txt'), encoding='utf-8') as f:
REQUIREMENTS = f.read()

# Arguments marked as "Required" below must be included for upload to PyPI.
# Fields marked as "Optional" may be commented out.
setup(
name='scl_loader', # Required
version='1.0.0', # Required
version='1.2.0', # Required
description='Outil de manipulation de SCD', # Required
long_description=LONG_DESCRIPTION, # Optional
long_description_content_type='text/markdown', # Optional (see note above)
Expand Down
Loading

0 comments on commit 7457e83

Please sign in to comment.