Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to support python3.11 #171

Merged
merged 8 commits into from Oct 12, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/main-publish.yml
Expand Up @@ -18,19 +18,21 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.11
- name: Install Python dependencies for publish
run: python -m pip install dcicutils==8.0.0
- name: Publish
env:
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install poetry
poetry publish --no-interaction --build --username=$PYPI_USER --password=$PYPI_PASSWORD
make configure
make publish-for-ga
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Expand Up @@ -18,27 +18,28 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python_version: [3.7, 3.8, 3.9]
python_version: ['3.8', '3.9', '3.10', '3.11']

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}

- name: Install Deps
run: |
pip install poetry coveralls codacy-coverage
make build
pip install coveralls codacy-coverage

- name: QA
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
poetry install
make configure
poetry run coverage run --source=wranglertools -m pytest -vv tests -m 'not ftp'
poetry run coveralls --service=github
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -4,7 +4,7 @@ clear-poetry-cache: # clear poetry/pypi cache. for user to do explicitly, never
poetry cache clear pypi --all

configure: # does any pre-requisite installs
pip install poetry==1.3.2
pip install poetry==1.4.2

lint:
flake8 wranglertools
Expand Down
745 changes: 365 additions & 380 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "Submit4DN"
version = "3.4.2"
version = "4.0.0"
description = "Utility package for submitting data to the 4DN Data Portal"
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
license = "MIT"
Expand All @@ -12,11 +12,11 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.7.0,<3.10"
python = ">=3.8.0,<3.12"
python-magic = ">=0.4.12,<1"
attrs = "^22.2"
openpyxl = "^3.1.2"
dcicutils = "^7.9.0"
dcicutils = "^8.0.0"
# awscli is not directly imported but is required for aws cp operation
awscli = "^1.27"

Expand Down
4 changes: 2 additions & 2 deletions tests/test_import_data.py
Expand Up @@ -131,13 +131,13 @@ def test_reader_with_sheetname(vendor_raw_xls_fields, workbooks):

@pytest.mark.file_operation
def test_reader_wrong_sheetname(capsys):
msg = "string indices must be integers\nEnzyme\nERROR: Can not find the collection sheet in excel file (openpyxl error)\n"
msg_end = "Enzyme\nERROR: Can not find the collection sheet in excel file (openpyxl error)\n"
sheet = 'Vendor'
sheetkey = "{}.xlsx".format(sheet)
readxls = imp.reader(sheetkey, 'Enzyme')
assert readxls is None
out = capsys.readouterr()[0]
assert out == msg
assert out.endswith(msg_end)


def test_cell_value(workbooks):
Expand Down
1 change: 1 addition & 0 deletions wranglertools/import_data.py
Expand Up @@ -1436,6 +1436,7 @@ def user_workflow_reader(workbook, sheet, connection):
def get_upload_creds(file_id, connection, extfilecreds=False): # pragma: no cover
creds2return = 'upload_credentials'
url = f"{file_id}/upload/"
import pdb; pdb.set_trace()
if extfilecreds:
creds2return = 'extra_files_creds'
req = ff_utils.authorized_request(f"{connection.key.get('server')}/{url}", auth=ff_utils.get_authentication_with_server(connection.key)).json()
Expand Down