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

201 update dependencies #202

Merged
merged 43 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a15e381
fix(cython bugs): remove awscli
sqr00t Sep 25, 2023
1141278
fix(cython bugs): update numpy==1.24.4, scipy==1.10.1, scikit-learn==…
sqr00t Sep 25, 2023
0af4119
fix(remove awscli): removes dependency on awscli for retrieving publi…
sqr00t Sep 27, 2023
e3a6d29
fix(app): remove numpy spec, remove awscli
sqr00t Sep 27, 2023
af6157e
fix(transformers): bump transformers version to 4.33.3 dependabot alert
sqr00t Sep 27, 2023
b42df79
chore(data download): remove duplicate code
sqr00t Sep 28, 2023
7a3693a
test-feat(windows actions): experiment adding platform dimensions to …
sqr00t Sep 28, 2023
a945e4e
test-fix(windows actions): try pip as pymodule
sqr00t Sep 28, 2023
beb5ca3
test-fix(windows actions): add runner.os conditional evals
sqr00t Sep 28, 2023
964cea0
test-fix(windows actions): rearrange config
sqr00t Sep 28, 2023
08ef449
test-fix(windows actions): attempt specifying bash shell
sqr00t Sep 28, 2023
81a0eaa
test-fix(windows actions): add encoding env var
sqr00t Sep 28, 2023
2917c3f
test-fix(windows actions): move encoding utf8 env var
sqr00t Sep 28, 2023
3d9d671
test-fix(windows actions): use SETX
sqr00t Sep 28, 2023
f87d175
test-fix(windows actions): change env setting syntax
sqr00t Sep 28, 2023
5f65ee1
test-fix(windows actions): move encoding utf8 env var
sqr00t Sep 28, 2023
4ee2408
test-fix(windows actions): try pip as py3 module with utf8 io env var
sqr00t Sep 28, 2023
03a08c6
test-fix(windows actions): try another env var
sqr00t Sep 28, 2023
ab33aad
test-fix(windows actions): remove editable mode install
sqr00t Sep 28, 2023
9475d9e
test-fix(windows actions): add back editable install
sqr00t Sep 28, 2023
f29626a
fix(windows actions): remove windows actions due to complexities
sqr00t Sep 28, 2023
66c5666
test-feat(gh actions cache): add caching pip dependencies
sqr00t Sep 28, 2023
77fa26b
revert
Aiden-RC Sep 28, 2023
b576760
Merge branch 'nestauk:dev' into dev
Aiden-RC Sep 28, 2023
ff5f996
Merge remote-tracking branch 'upstream/201_update_dependencies' into dev
Aiden-RC Sep 28, 2023
d5703d3
Merge branch 'dev' of https://github.com/Aiden-RC/ojd_daps_skills int…
Aiden-RC Sep 28, 2023
24bd7c3
Update pytest.yml
Aiden-RC Sep 28, 2023
fcaea55
Update pytest.yml
Aiden-RC Sep 28, 2023
8b514c0
Update setup.py
Aiden-RC Sep 28, 2023
c03a948
try except potential fix for tag cmd
Aiden-RC Sep 28, 2023
961063d
Update setup.py
Aiden-RC Sep 28, 2023
2c55d0a
Update setup.py
Aiden-RC Sep 28, 2023
9d2dade
Update setup.py
Aiden-RC Sep 28, 2023
5fbe787
remove probably un-used code
Aiden-RC Sep 28, 2023
f971eae
remove aws cli from requirements
Aiden-RC Sep 28, 2023
ad825e1
Merge pull request #204 from Aiden-RC/dev
india-kerle Oct 6, 2023
31e58f7
fix(version tag): add pyproject.toml to use setuptools_scm with relea…
sqr00t Oct 6, 2023
ccd6c36
fix(merge conflict): remove workflow action on pull request
sqr00t Oct 6, 2023
505db88
fix(merge conflict): remove AWSCLI section of docs
sqr00t Oct 6, 2023
0f5470d
chore(setup): use Path object instead of os.path, remove unused imports
sqr00t Oct 6, 2023
efebf85
feat(gh actions cache): enable caching unchanged pip dependencies
sqr00t Oct 6, 2023
d2fdbae
chore!(file download): remove manual download of base model, remove c…
sqr00t Oct 9, 2023
958fd6e
chore(docs): update Sphinx autodocs
sqr00t Oct 9, 2023
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
30 changes: 26 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
name: Unit Tests

on: [push]
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os.host }}
strategy:
matrix:
python-version: ["3.8", "3.9"]
os:
- name: ubuntu
host: ubuntu-latest
- name: windows
host: windows-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies

- name: (ubuntu) Install dependencies
if: runner.os != 'windows'
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
python -m spacy download en_core_web_sm
pip install -e ."[test]"
- name: Test with pytest
- name: (ubuntu) Test with pytest
if: runner.os != 'windows'
run: |
pytest --verbose

- name: (windows) Install dependencies
if: runner.os == 'windows'
shell: bash
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
python -m spacy download en_core_web_sm
pip install -e .
- name: (windows) Test with pytest
if: runner.os == 'windows'
shell: bash
run: |
pytest --verbose
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ You will also need to download [spaCy's](https://spacy.io/models/en) `en_core_we
python -m spacy download en_core_web_sm
```

### AWS CLI
sqr00t marked this conversation as resolved.
Show resolved Hide resolved

When the package is first used it will automatically download a folder of neccessary data and models. This file is ~ 1GB. Although you don't need to have AWS credentials for this to work, you will need to download the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

## TL;DR: Using Nesta's Skills Extractor library <a name="usage"></a>

The library supports three key skills extraction functionalities :
Expand Down
4 changes: 1 addition & 3 deletions ojd_daps_skills/app/requirements_app.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
numpy==1.21.1
ojd-daps-skills
awscli==1.27.25
streamlit== 1.16.0
streamlit==1.16.0
30 changes: 24 additions & 6 deletions ojd_daps_skills/getters/download_public_data.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
from ojd_daps_skills import PUBLIC_DATA_FOLDER_NAME, PROJECT_DIR

import os

import boto3
from botocore.exceptions import ClientError
from botocore import UNSIGNED
from botocore.config import Config
from zipfile import ZipFile

def download():
sqr00t marked this conversation as resolved.
Show resolved Hide resolved
"""Download public data. Expected to run once on first use."""
s3 = boto3.client(
"s3", region_name="eu-west-1", config=Config(signature_version=UNSIGNED)
)

bucket_name = "open-jobs-indicators"
key = f"escoe_extension/{PUBLIC_DATA_FOLDER_NAME}.zip"

public_data_dir = os.path.join(PROJECT_DIR, PUBLIC_DATA_FOLDER_NAME)

os.system(
f"aws --no-sign-request --region=eu-west-1 s3 cp s3://open-jobs-indicators/escoe_extension/{PUBLIC_DATA_FOLDER_NAME}.zip {public_data_dir}.zip"
)
os.system(f"unzip {public_data_dir}.zip -d {PROJECT_DIR}")
os.system(f"rm {public_data_dir}.zip")
try:
s3.download_file(bucket_name, key, f"{public_data_dir}.zip")

with ZipFile(f"{public_data_dir}.zip", "r") as zip_ref:
zip_ref.extractall(PROJECT_DIR)

os.remove(f"{public_data_dir}.zip")

except ClientError as ce:
print(f"Error: {ce}")
except FileNotFoundError as fnfe:
print(f"Error: {fnfe}")


if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
numpy==1.22.4
scipy==1.8.1
numpy==1.24.4
scipy==1.10.1
pandas==1.3.5
tqdm==4.64.0
filelock==3.7.1
typer==0.4.1
sh==1.14.2
transformers==4.20.1
transformers==4.33.3
sentence-transformers==2.2.2
scikit-learn==0.23.2
scikit-learn==1.3.1
spacy==3.4.0
nervaluate==0.1.8
s3fs==2022.5.0
Expand Down
1 change: 0 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ black
Sphinx
sphinxcontrib-napoleon
sphinx-rtd-theme
awscli==1.27.32
pre-commit
pre-commit-hooks
spacy==3.4.0
Expand Down
19 changes: 13 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@

import os
import subprocess
import platform

tag_cmd = "git describe --tags --abbrev=0"
tag_cmd = tag_cmd if platform.system() == "Windows" else f"echo $({tag_cmd})"

tag_cmd = "echo $(git describe --tags --abbrev=0)"
tag_version = (
subprocess.check_output(tag_cmd, shell=True).decode("ascii").replace("\n", "")
)

try:
tag_version = (
subprocess.check_output(tag_cmd, shell=False).decode("ascii").replace("\n", "")
)
except:
#an error occurred, potentially an issue with git cli
tag_version = "v1.0.0"

print(f"Tag version: {tag_version}")

def read_lines(path):
"""Read lines of `path`."""
Expand All @@ -24,7 +31,7 @@ def read_lines(path):

setup(
name="ojd_daps_skills",
long_description=open(os.path.join(BASE_DIR, "README.md")).read(),
long_description=open(os.path.join(BASE_DIR, "README.md"), encoding="utf-8").read(),
long_description_content_type="text/markdown",
install_requires=read_lines(os.path.join(BASE_DIR, "requirements.txt")),
extras_require={"dev": read_lines(os.path.join(BASE_DIR, "requirements_dev.txt"))},
Expand Down