Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Fix use of importlib.metadata and unify requirements.txt #8

Merged
merged 3 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.7"
- "3.10"
steps:
- uses: actions/checkout@v2
- name: Setup Rust toolchain
Expand All @@ -40,13 +46,14 @@ jobs:
key: target-maturin-cache-
- uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: ${{ matrix.python-version }}
- name: Create Virtualenv
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run Linters
if: ${{ matrix.python-version == '3.10' }}
run: |
source venv/bin/activate
flake8 --exclude venv --ignore=E501
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ python3 -m venv venv
source venv/bin/activate
# update pip itself if necessary
python -m pip install -U pip
# if python -V gives python 3.7
python -m pip install -r requirements-37.txt
# if python -V gives python 3.8/3.9/3.10
# install dependencies
python -m pip install -r requirements.txt
```

Expand All @@ -161,9 +159,6 @@ To change test dependencies, change the `requirements.in` and run
```bash
# install pip-tools (this can be done only once), also consider running in venv
python -m pip install pip-tools

# change requirements.in and then run
python -m piptools compile --generate-hashes -o requirements-37.txt
# or run this is you are on python 3.8/3.9/3.10
python -m piptools compile --generate-hashes -o requirements.txt
```
Expand Down
9 changes: 7 additions & 2 deletions datafusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
from abc import ABCMeta, abstractmethod
from typing import List

import importlib.metadata
try:
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata


import pyarrow as pa

from ._internal import (
Expand All @@ -30,7 +35,7 @@
)


__version__ = importlib.metadata.version("datafusion")
__version__ = importlib_metadata.version(__name__)


__all__ = [
Expand Down
Loading