From 0335e4c6eea3a983daccf23de4e62d754dc120a2 Mon Sep 17 00:00:00 2001 From: Jordan Day Date: Thu, 28 Nov 2024 12:18:17 +0000 Subject: [PATCH] Update git workflow and package structure - Package requirements now stored in setup.cfg - removed old text requirements files - updated workflow --- .github/workflows/main.yaml | 1 - README.md | 2 +- requirements-dev.txt | 15 --------------- requirements.txt | 5 ----- setup.cfg | 37 +++++++++++++++++++++++++++++++++++++ setup.py | 24 +++--------------------- 6 files changed, 41 insertions(+), 43 deletions(-) delete mode 100755 requirements-dev.txt delete mode 100755 requirements.txt create mode 100644 setup.cfg diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 927ef362..56fd0b4d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -14,7 +14,6 @@ jobs: - uses: actions/setup-python@v3 with: python-version: 3.10.13 - cache: 'pip' - name: Install Python dependencies run: | diff --git a/README.md b/README.md index 2376720a..3b83ce89 100755 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To be added. To install the Python requirements, open your terminal and enter: ```shell -pip install -r requirements.txt +pip install . ``` or for installing in development mode: diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100755 index 072c8eb1..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Development packages - -coverage -detect-secrets==1.0.3 -myst-parser -pre-commit -pytest==7.0.1 -Sphinx -toml -black -isort -nbstripout -nbqa -pre_commit_hooks -flake8 diff --git a/requirements.txt b/requirements.txt deleted file mode 100755 index 64420ce6..00000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pandas -numpy -# rdsa-utils -# raz-client -# boto3 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..c072f19f --- /dev/null +++ b/setup.cfg @@ -0,0 +1,37 @@ +[metadata] +name = monthly-business-survey-results +description = Public Sector local Python downloads and preprocessing package +url = https://github.com/ONSdigital/monthly-business-survey-results +version = 0.1.1 +author = Office for National Statistics +platforms = win32 +classifiers = + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + +[options] +packages = + mbs_results +install_requires = + pyyaml + pandas + numpy + # rdsa-utils + # raz-client + # boto3 +python_requires = >=3.6 +zip_safe = no + + +[options.extras_require] +dev = + coverage + detect-secrets==1.0.3 + myst-parser + pre-commit + pytest==7.0.1 + Sphinx + toml + diff --git a/setup.py b/setup.py index 669d4606..7f1a1763 100755 --- a/setup.py +++ b/setup.py @@ -1,22 +1,4 @@ -"""Setup script for creating package from code.""" +from setuptools import setup -from setuptools import find_packages, setup - -with open("requirements.txt") as f: - requirements = f.read().splitlines() - -with open("requirements-dev.txt") as f: - requirements_dev = f.read().splitlines() - -setup( - name="monthly-business-survey-results", - version="0.1.1", - description="Public Sector local Python downloads and preprocessing package", - url="https://github.com/ONSdigital/monthly-business-survey-results", - packages=find_packages(), - package_data={"": ["*.toml", "*.r", "*.R", "*.pem"]}, - include_package_data=True, - zip_safe=False, - install_requires=requirements, - extras_require={"dev": requirements_dev}, -) +if __name__ == "__main__": + setup()