diff --git a/.github/workflows/python-check.yml b/.github/workflows/python-check.yml new file mode 100644 index 0000000..8a76024 --- /dev/null +++ b/.github/workflows/python-check.yml @@ -0,0 +1,45 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python check + +on: + push: + branches: [ "main", "ci/*" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.12.1 + + - name: Install poetry + run: | + sudo apt update && sudo apt install pipx && pipx ensurepath && pipx install poetry==1.8.2 + + - name: Cache the virtualenv + uses: actions/cache@v3 + with: + path: ./.venv + key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} + + - name: Install dependencies + run: | + poetry install + + - name: Lint + run: | + poetry run pylint playground tests + + - name: Tests + run: | + poetry run pytest tests diff --git a/README.md b/README.md index 9264379..0211869 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ This playground contains a basic set-up to interact with the data using [Jupyter # How to play ## Prerequisites -- [Python >= 3.11](https://www.python.org/downloads/) +- [Python >= 3.12](https://www.python.org/downloads/) - [Poetry](https://python-poetry.org/docs/#installation) - Access to a DevLake database - A place to run a Jupyter Notebook (e.g. [VS Code](https://code.visualstudio.com/)) diff --git a/tests/__init__.py b/tests/__init__.py index d16c64f..65d64ce 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -12,4 +12,3 @@ # 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. -