diff --git a/.github/workflows/freeze_requirements.yml b/.github/workflows/freeze_requirements.yml new file mode 100644 index 000000000..de49439f5 --- /dev/null +++ b/.github/workflows/freeze_requirements.yml @@ -0,0 +1,32 @@ +name : Freeze release requirements + +on: + push: + tags: + - '*' + +jobs: + freeze_requirements: + runs-on: ubuntu-latest + steps: + - + name: Checkout scilpy + uses: actions/checkout@v3 + - + name: Install python + uses: actions/setup-python@v4 + with: + python-version-file: '.python-version' + cache: 'pip' + - + name: Freeze requirements + id: requirements-freezer + run: | + pip install pip-tools + pip-compile --no-upgrade --allow-unsafe -o requirements.${{ github.ref_name }}.frozen + echo "requirements=$PWD/requirements.${{ github.ref_name }}.frozen" >> $GITHUB_OUTPUT + - + name: Upload frozen requirements to release + uses: softprops/action-gh-release@v1 + with: + files : ${{ steps.requirements-freezer.outputs.requirements }} diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..7c7a975f4 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 9c3fcdc13..d9871f653 100644 --- a/requirements.txt +++ b/requirements.txt @@ -30,7 +30,6 @@ pytest-mock==3.10.* python-dateutil==2.8.* pytz==2022.6.* requests==2.28.* -setuptools==64.0.* scikit-learn==1.2.* scipy==1.9.* six==1.16.* diff --git a/scilpy/version.py b/scilpy/version.py index edba41e44..d72f19157 100644 --- a/scilpy/version.py +++ b/scilpy/version.py @@ -25,6 +25,24 @@ "Programming Language :: Python", "Topic :: Scientific/Engineering"] +PYTHON_VERSION = "" +with open('.python-version') as f: + py_version = f.readline().strip("\n").split(".") + py_major = py_version[0] + py_minor = py_version[1] + py_micro = "*" + py_extra = None + if len(py_version) > 2: + py_micro = py_version[2] + if len(py_version) > 3: + py_extra = py_version[3] + + PYTHON_VERSION = ".".join([py_major, py_minor, py_micro]) + if py_extra: + PYTHON_VERSION = ".".join([PYTHON_VERSION, py_extra]) + + PYTHON_VERSION = "".join(["==", PYTHON_VERSION]) + # Description should be a one-liner: description = "Scilpy: diffusion MRI tools and utilities" # Long description will go up on the pypi page diff --git a/setup.py b/setup.py index bcaba2b36..993a250ff 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ def run(self): packages=find_packages(), cmdclass={'build_ext': CustomBuildExtCommand}, ext_modules=get_extensions(), + python_requires=PYTHON_VERSION, setup_requires=['cython', 'numpy'], install_requires=external_dependencies, entry_points={