diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 1502dff..65725ea 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -1,6 +1,6 @@ name: Upload Package to Pypi -on: [push, pull_request] +on: [push] jobs: deploy: diff --git a/.github/workflows/python2-3-app.yml b/.github/workflows/python2-3-app.yml index c938a8e..f739b16 100644 --- a/.github/workflows/python2-3-app.yml +++ b/.github/workflows/python2-3-app.yml @@ -1,6 +1,6 @@ name: DB12 testing -on: [push, pull_request] +on: [pull_request] jobs: pre-commit: @@ -33,6 +33,7 @@ jobs: - uses: actions/checkout@v4 - name: Installing dependencies run: | + apt update && apt install -y git python -m pip install pytest mock pip install -e . - name: Run pytest @@ -49,12 +50,13 @@ jobs: - 2.7.18 - 3.6.15 - 3.9.17 + - 3.11.4 container: python:${{ matrix.python }}-slim steps: - uses: actions/checkout@v4 - name: Installing dependencies run: | - python -m pip install pylint pytest mock + python -m pip install pylint pytest mock pytest-mock - name: Run pylint run: pylint -E src/db12 tests diff --git a/environment.yml b/environment.yml index 06cf492..2c11af2 100644 --- a/environment.yml +++ b/environment.yml @@ -4,5 +4,8 @@ dependencies: - python =3.9 - future - pre-commit + - pytest + - mock + - pytest-mock - pip: - -e . diff --git a/pyproject.toml b/pyproject.toml index 494f262..5d7bf33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,2 @@ -[build-system] -requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] -build-backend = "setuptools.build_meta" - -# Enable setuptools_scm to compute the version number from the most recent tag -# https://github.com/pypa/setuptools_scm/#pyprojecttoml-usage -[tool.setuptools_scm] -# Avoid letting setuptools_scm use old style tags (i.e. vXrYpZ) -git_describe_command = "git describe --dirty --tags --long --match *[0-9].[0-9]* --exclude v[0-9]r* --exclude v[0-9][0-9]r*" - [tool.isort] profile = "black" - diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..ac4d8f8 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,37 @@ +############################################################################### +# Setuptools +############################################################################### + +[metadata] +name = DB12 +description = DIRAC Benchmark 2012 +long_description = file: README.md +url = https://github.com/DIRACGrid/DB12/ +license = GPL-3.0-only +license_files = LICENSE +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Science/Research + License :: OSI Approved :: GNU General Public License v3 (GPLv3) + Programming Language :: Python :: 3 + Topic :: Scientific/Engineering + Topic :: System :: Distributed Computing + +[options] +package_dir = + = src +packages = find: +zip_safe = False +include_package_data = True + +[options.package_data] +* = factors.json + +[options.packages.find] +where=src + +[options.entry_points] +db12 = + metadata = db12:extension_metadata +console_scripts = + db12 = db12.__main__:main diff --git a/setup.py b/setup.py index 2cc700e..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,32 +1,3 @@ -import setuptools +from setuptools import setup -with open("README.md", "r") as fh: - long_description = fh.read() - -setuptools.setup( - name="DB12", - description="DIRAC Benchmark 2012", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/pypa/DIRACGrid/DB12", - use_scm_version=True, - setup_requires=["setuptools_scm"], - project_urls={ - "Bug Tracker": "https://github.com/DIRACGrid/DB12/issues", - }, - classifiers=[ - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 2.7", - "Operating System :: OS Independent", - ], - package_dir={"": "src"}, - package_data={"": ["factors.json"]}, - packages=setuptools.find_packages(where="src"), - python_requires=">=2.7", - test_suite="tests", - entry_points={ - "console_scripts": [ - "db12 = db12.__main__:main", - ], - }, -) +setup()