diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 6452986..92ffe7d 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -4,20 +4,20 @@ on: [push] jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + - name: Check out repository + uses: actions/checkout@v2 - name: Set up Python 3.9 uses: actions/setup-python@v2 with: python-version: 3.9 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install poetry + uses: snok/install-poetry@v1.2 + with: + virtualenvs-create: true + virtualenvs-in-project: true + - name: Setup + run: bash setup.sh - name: Analysing the code with pylint - run: | - python -m pylint --fail-under=9 `find -regextype egrep -regex '(.*.py)$'` + run: poetry run pylint ./src diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 0d438ee..e9d71c8 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -10,27 +10,23 @@ jobs: name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@v2.2.2 + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 with: - python-version: 3.7 - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . + python-version: 3.9 + - name: Install poetry + uses: snok/install-poetry@v1.2 + with: + virtualenvs-create: true + virtualenvs-in-project: true + - name: Setup + run: bash setup.sh + - name: Build + run: poetry build - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master + run: poetry publish with: password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/.pylintrc b/.pylintrc index c9d9b5b..b9a7a47 100644 --- a/.pylintrc +++ b/.pylintrc @@ -17,14 +17,14 @@ extension-pkg-whitelist= fail-on= # Specify a score threshold to be exceeded before program exits with error. -fail-under=10.0 +fail-under=9.0 # Files or directories to be skipped. They should be base names, not paths. -ignore=CVS +ignore= # Add files or directories matching the regex patterns to the ignore-list. The # regex matches against paths. -ignore-paths= +ignore-paths=.venv/*, .git/*, .github/* # Files or directories matching the regex patterns are skipped. The regex # matches against base names, not paths. diff --git a/pyproject.toml b/pyproject.toml index 2480ca2..b919b80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,25 @@ +[tool.poetry] +name = "opensignals" +version = "0.0.2" +description = "" +authors = ["Jordi Villar "] + +[tool.poetry.urls] +Issues = "https://github.com/councilofelders/opensignals/issues" + +[tool.poetry.dependencies] +python = ">=3.8,<3.11" +docopt = "^0.6.2" +pandas = "^1.3.4" +numpy = "^1.21.3" +pyarrow = "^6.0.0" +requests = "^2.26.0" +tqdm = "^4.62.3" + +[tool.poetry.dev-dependencies] +pylint = "^2.11.1" + [build-system] -requires = [ - 'setuptools>=42', - 'wheel' -] -build-backend = 'setuptools.build_meta' \ No newline at end of file +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..eb339e5 --- /dev/null +++ b/setup.sh @@ -0,0 +1,19 @@ +#! /usr/bin/bash +echo "install poetry if not in path" +if ! command -v poetry &> /dev/null +then + echo "poetry is missing. Installing ..." + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + source "$HOME/.poetry/env" +fi + +echo "setting up poetry config" +poetry config virtualenvs.path .venv +poetry config virtualenvs.create true +poetry config virtualenvs.in-project true + +echo "installing dependencies" +poetry install --no-interaction --no-root + +echo "installing libraries" +poetry install --no-interaction