Skip to content

Commit

Permalink
Merge pull request #184 from nestauk/Aiden-RC-windows-changes
Browse files Browse the repository at this point in the history
Windows Related Changes
  • Loading branch information
india-kerle authored Oct 6, 2023
2 parents f24eb5c + fc59309 commit d400b35
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ You will also need to download [spaCy's](https://spacy.io/models/en) `en_core_we
python -m spacy download en_core_web_sm
```

Note that this package was developed on MacOS and tested on Ubuntu. Changes have been made to be compatible on a Windows system but are not tested and cannot be guaranteed.
### AWS CLI

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).
Expand Down Expand Up @@ -186,6 +187,8 @@ Various pieces of analysis are done in the [analysis folder](https://github.com/

The technical and working style guidelines can be found [here](https://github.com/nestauk/ds-cookiecutter/blob/master/GUIDELINES.md).

If contributing, changes will need to be pushed to a new branch in order for our code checks to be triggered.

---

<small><p>This project was made possible via funding from the <a target="_blank" href="https://www.escoe.ac.uk/">Economic Statistics Centre of Excellence</a></p></small>
Expand Down
17 changes: 15 additions & 2 deletions ojd_daps_skills/getters/download_public_data.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
from ojd_daps_skills import PUBLIC_DATA_FOLDER_NAME, PROJECT_DIR

import os

import platform
import zipfile

def download():

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

if platform.system() == "Windows":
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"'
)
with zipfile.ZipFile(f"{public_data_dir}.zip", 'r') as zip_ref:
zip_ref.extractall(f"{PROJECT_DIR}")
zip_ref.close()
os.remove(f"{public_data_dir}.zip")

return

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"
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")



if __name__ == "__main__":
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
from setuptools import setup

import os
import platform
import subprocess


tag_cmd = "echo $(git describe --tags --abbrev=0)"
tag_cmd = "git describe --tags --abbrev=0"
tag_cmd = tag_cmd if platform.system() == "Windows" else f"echo $({tag_cmd})"
tag_version = (
subprocess.check_output(tag_cmd, shell=True).decode("ascii").replace("\n", "")
)
Expand All @@ -24,7 +26,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

0 comments on commit d400b35

Please sign in to comment.