Skip to content

Commit

Permalink
Merge pull request #92 from chaosAD/master
Browse files Browse the repository at this point in the history
Added GitHub action
  • Loading branch information
alexgand authored May 7, 2020
2 parents bbd7cd9 + b091e10 commit 6cd22c6
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 28 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package and testrun

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

jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
runs-on: ${{ matrix.platform }}
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 flake8
pip install -r requirements.txt
- name: Lint with flake8
run: |
# 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
- name: Test run
run: |
python main.py -i 23
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Python script to download all Springer books released for free during the 2020 COVID-19 quarantine

![Python package and testrun](https://github.com/alexgand/springer_free_books/workflows/Python%20package%20and%20testrun/badge.svg)
### Books available
It used to have 409 english books (it took about 4 hours to complete the download ~ 14 GB, both PDF and EPUB, on my machine), but Springer has since removed some of them from the open access.

Expand Down Expand Up @@ -77,7 +77,7 @@ The following invalid book categories will be ignored:
### Running in a virtual environment (Bash commands):
```bash
python3 -m venv .venv
. .venv/bin/activate
source .venv/bin/activate
pip install -r requirements.txt
python3 main.py
```
Expand All @@ -99,7 +99,7 @@ python main.py
```winbatch
python -m virtualenv .venv
.venv\Scripts\activate.bat
pip install -r requirements2x.txt
pip install -r requirements.txt
python main.py
```

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ chardet==3.0.4
et-xmlfile==1.0.1
idna==2.9
jdcal==1.4.1
numpy==1.18.2
openpyxl==3.0.3
pandas==1.0.3
numpy>=1.16.6
openpyxl>=2.6.4
pandas>=0.24.2
python-dateutil==2.8.1
pytz==2019.3
requests==2.23.0
six==1.14.0
tqdm==4.45.0
urllib3==1.25.8
urllib3>=1.25.8
xlrd==1.2.0
15 changes: 0 additions & 15 deletions requirements2x.txt

This file was deleted.

12 changes: 6 additions & 6 deletions run_VirtualEnv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ for /f "tokens=2 delims=. " %%f in ('python --version') do set majorVersion=%%f
echo Detected Python major version: %majorVersion%

::-- Create virtual environment
python -m venv .venv
if "%majorVersion%"=="2" (
python -m virtualenv .venv
) else (
python -m venv .venv
)

::--- Activate virtual environment
call .venv\Scripts\activate.bat
Expand All @@ -15,11 +19,7 @@ call .venv\Scripts\activate.bat
python -m pip install --upgrade pip

::-- Install requirements at virtual environment
if "%majorVersion%"=="2" (
pip install -r requirements2x.txt
) else (
pip install -r requirements.txt
)
pip install -r requirements.txt

::-- Run main program at virtual environment
python main.py
Expand Down

0 comments on commit 6cd22c6

Please sign in to comment.