diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 56d2173..122edb0 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -12,19 +12,19 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - - name: Set up Python 3.9 - uses: actions/setup-python@v3 + - name: Install the latest version of uv and set the python version + uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 with: - python-version: "3.9" + python-version: '3.14' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install flake8 - name: Lint with flake8 run: | @@ -32,11 +32,11 @@ jobs: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide, we further relax this flake8 . --count --exit-zero --max-complexity=30 --max-line-length=130 --statistics + - name: Build run: | - pip install build - python -m build + uv build + - name: Test with pytest run: | - if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi - pytest --cov-report term --cov=cs3client tests/ + uv run pytest --cov-report term --cov=cs3client tests/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..149b253 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,40 @@ +[build-system] +requires = ["hatchling==1.33.0"] +build-backend = "hatchling.build" + +[project] +name = "cs3client" +description = "CS3 client for Python" +version = "1.8.0" +authors = [ + { name = "Rasmus Welander" }, + { name = "Diogo Castro" }, + { name = "Giuseppe Lo Presti" }, +] +readme = "README.md" +license = { file = "LICENSE" } +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", +] +requires-python = ">=3.10" +dependencies = [ + "grpcio>=1.47.0", + "grpcio-tools>=1.47.0", + "pyOpenSSL", + "requests", + "cs3apis>=0.1.dev101", + "PyJWT", + "protobuf", + "cryptography", +] + +[project.urls] +Homepage = "https://github.com/cs3org/cs3-python-client" +GitHub = "https://github.com/cs3org/cs3-python-client" + +[dependency-groups] +dev = ["pytest", "pytest-cov", "sphinx"] + +[tool.hatch.build.targets.wheel] +packages = ["cs3client"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 83cce73..0000000 --- a/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -grpcio>=1.47.0 -grpcio-tools>=1.47.0 -pyOpenSSL -requests -cs3apis>=0.1.dev101 -PyJWT -protobuf -cryptography -sphinx \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 2dd693a..0000000 --- a/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -setup.py - -setup file for the cs3client package. - -Authors: Rasmus Welander, Diogo Castro, Giuseppe Lo Presti. -Emails: rasmus.oscar.welander@cern.ch, diogo.castro@cern.ch, giuseppe.lopresti@cern.ch -Last updated: 30/08/2024 -""" - -from setuptools import setup, find_packages -import os - -with open("README.md", "r") as fh: - long_description = fh.read() - -version = os.getenv("PACKAGE_VERSION", "0.0.0") - -setup( - name="cs3client", - version=version, - author="Rasmus Welander, Diogo Castro, Giuseppe Lo Presti", - description="CS3 client for Python", - long_description=long_description, - long_description_content_type="text/markdown", - packages=find_packages(exclude=['tests*']), - url="https://github.com/cs3org/cs3-python-client", - install_requires=[ - "grpcio>=1.47.0", - "grpcio-tools>=1.47.0", - "pyOpenSSL", - "requests", - "cs3apis", - "PyJWT", - "protobuf", - "cryptography", - ], - license="Apache 2.0", - classifiers=[ - "Development Status :: 4 - Beta", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - ], -)