diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbf1483..1da0bbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,18 +21,22 @@ jobs: name: Python ${{ matrix.python-version }} Tests steps: - uses: actions/checkout@v3 + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: x64 - - name: Python Tests + + - name: Install project with dev dependencies run: | - conda create --quiet --name test pytest - export PATH="/usr/share/miniconda/bin:$PATH" - source activate test - pip install bandit black isort flake8 - pip install . + python -m pip install --upgrade pip + pip install .[dev] npm install -g markdownlint-cli@0.33.0 + + - name: Run tests + run: | make test - scraper -h + + - name: Show scraper help + run: scraper -h diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index e534d45..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include requirements/*.txt diff --git a/Makefile b/Makefile index 5d7abcf..d0824f7 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ test: pyflakes scraper release: test - python3 setup.py sdist bdist_wheel + python3 -m build . upload: twine upload --skip-existing dist/* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a9803ef --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "llnl-scraper" +version = "0.16.0" +description = "Package for extracting software repository metadata" +readme = "README.md" +requires-python = ">=3.8" +authors = [{ name = "Ian Lee", email = "lee1001@llnl.gov" }] +license = { text = "MIT" } +keywords = [] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = [ + "github3.py>=2.0.0", + "msrest>=0.6.4", + "python-dateutil>=2.7.3", + "python-gitlab>=1.6.0", + "pytz>=2017.3", + "requests>=2.16", + "setuptools>=24.2.0", + "stashy>=0.3", + "vsts>=0.1.25", +] + +[project.urls] +Homepage = "https://github.com/llnl/scraper" + +[project.scripts] +scraper = "scraper.gen_code_gov_json:main" + +[project.optional-dependencies] +dev = [ + "ipython", + "twine", + "build", + "bandit", + "black", + "flake8", + "isort", + "pyflakes", + "safety", +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b0c3540..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ --r requirements/dev.txt diff --git a/requirements/dev.txt b/requirements/dev.txt deleted file mode 100644 index 5aff939..0000000 --- a/requirements/dev.txt +++ /dev/null @@ -1,13 +0,0 @@ --r production.txt - -# Development tools -ipython -twine - -# Testing tools -bandit -black -flake8 -isort -pyflakes -safety diff --git a/requirements/production.txt b/requirements/production.txt deleted file mode 100644 index f462d59..0000000 --- a/requirements/production.txt +++ /dev/null @@ -1,9 +0,0 @@ -github3.py>=2.0.0 -msrest>=0.6.4 -python-dateutil>=2.7.3 -python-gitlab>=1.6.0 -pytz>=2017.3 -requests>=2.16 -setuptools>=24.2.0 -stashy>=0.3 -vsts>=0.1.25 diff --git a/setup.py b/setup.py deleted file mode 100644 index 593d1b1..0000000 --- a/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- - -from setuptools import find_packages, setup - -with open("README.md") as fh: - long_description = fh.read() - -with open("requirements/production.txt") as fp: - lines = [x.strip() for x in fp.readlines() if x] - install_reqs = [x for x in lines if not x.startswith("#")] - -setup( - name="llnl-scraper", - version="0.15.0", - description="Package for extracting software repository metadata", - long_description=long_description, - long_description_content_type="text/markdown", - author="Ian Lee", - author_email="lee1001@llnl.gov", - url="https://github.com/llnl/scraper", - packages=find_packages(), - install_requires=install_reqs, - python_requires=">=3.6", - entry_points={ - "console_scripts": [ - "scraper = scraper.gen_code_gov_json:main", - ] - }, - scripts=[ - "scripts/codegov_compute_hours.py", - ], - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], -)