diff --git a/.github/workflows/python-package-3.8.yml b/.github/workflows/python-package-3.8.yml new file mode 100644 index 000000000..34f9f921d --- /dev/null +++ b/.github/workflows/python-package-3.8.yml @@ -0,0 +1,58 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: pip-install + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache dependencies + id: myCache + uses: actions/cache@v2 + with: + path: /opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install dependencies + if: steps.myCache.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Format the code with black + run: python -m black bcdi --check + + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. Use the default of 88 chars + python -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics + + - name: Type check with mypy + run: python -m mypy bcdi + + - name: Test with pytest + run: python -m pytest diff --git a/.github/workflows/python-package-3.9.yml b/.github/workflows/python-package-3.9.yml index a71b085a8..3e131a48c 100644 --- a/.github/workflows/python-package-3.9.yml +++ b/.github/workflows/python-package-3.9.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: python-package-3.9 +name: pip-install on: push: @@ -38,7 +38,7 @@ jobs: if: steps.myCache.outputs.cache-hit != 'true' run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest black mypy + python -m pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Format the code with black diff --git a/.github/workflows/python-package-conda-3.9.yml b/.github/workflows/python-package-conda-3.9.yml deleted file mode 100644 index f0b7ee8ae..000000000 --- a/.github/workflows/python-package-conda-3.9.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: python-package-conda-3.9 - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build-linux: - runs-on: ubuntu-latest - strategy: - max-parallel: 5 - matrix: - python-version: [ 3.9 ] - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Add conda to system path - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - echo $CONDA/bin >> $GITHUB_PATH - - name: Install dependencies - run: | - conda env update --file environment.yml --name base - - name: Lint with flake8 - run: | - conda install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. Use the default of 88 chars - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics - - name: Type check with mypy - run: | - conda install mypy - python -m mypy bcdi - - name: Test with pytest - run: | - conda install pytest - pytest diff --git a/environment.yml b/environment.yml deleted file mode 100644 index d5d132fd8..000000000 --- a/environment.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: bcdi -channels: - - defaults - - anaconda - - menpo - - conda-forge -dependencies: - - python=3.9 - - numpy - - scipy - - scikit-image - - matplotlib - - h5py - - traits - - vtk - - importlib_resources - - xrayutilities - - fabio - - silx - - lmfit - - moviepy - - mypy - - pillow - - pandas - - pytables - - pyqt - - ipywidgets - - pyyaml - - black - - coverage - - doit - - pycodestyle - - pydocstyle - - pyfakefs - - sphinx - - twine - - wheel - - pip: - - hdf5plugin - - sphinxcontrib-mermaid diff --git a/requirements.txt b/requirements.txt index 1691c4575..aaac88acc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,31 +1,31 @@ -numpy -scipy -scikit-image -matplotlib -hdf5plugin -h5py -traits -importlib_resources -xrayutilities -vtk -fabio -silx -lmfit -moviepy -pillow -tables -pandas -pyqt5 -ipywidgets -pyyaml -black -coverage -doit -mypy -pycodestyle -pydocstyle -pyfakefs -sphinx -sphinxcontrib-mermaid -twine -wheel \ No newline at end of file +black==22.1.0 +coverage==6.3.2 +doit==0.34.2 +fabio==0.13.0 +h5py==3.6.0 +hdf5plugin==3.2.0 +importlib-resources==5.4.0 +ipywidgets==7.7.0 +lmfit==1.0.3 +matplotlib==3.5.1 +moviepy==1.0.3 +mypy==0.941 +numpy==1.22.3 +pandas==1.4.1 +Pillow==9.0.1 +pycodestyle==2.8.0 +pydocstyle==6.1.1 +pyfakefs==4.5.6 +PyQt5==5.15.6 +PyYAML==6.0 +scikit-image==0.19.2 +scipy==1.8.0 +silx==1.0.0 +Sphinx==4.4.0 +sphinxcontrib-mermaid==0.7.1 +tables==3.7.0 +traits==6.3.2 +twine==3.8.0 +vtk==9.1.0 +wheel==0.37.1 +xrayutilities==1.7.3 \ No newline at end of file diff --git a/setup.py b/setup.py index 60077d489..1189c035c 100644 --- a/setup.py +++ b/setup.py @@ -127,44 +127,44 @@ 6. Creating figures for publication using templates.""", url="https://github.com/carnisj/bcdi", project_urls={"Documentation": "https://bcdi.readthedocs.io/en/latest/"}, - python_requires=">=3.6*, <3.10", + python_requires="==3.6*, <3.10", install_requires=[ - "numpy", - "scipy", - "scikit-image", - "matplotlib", - "hdf5plugin", - "h5py", - "traits", - "vtk", - "importlib_resources", - "xrayutilities", - "fabio", - "silx", - "pyyaml", - "tables", - "lmfit", - "moviepy", - "pillow", - "pandas", - "pyqt5", - "ipywidgets", + "fabio==0.13.0", + "hdf5plugin==3.2.0", + "h5py==3.6.0", + "importlib-resources==5.4.0", + "ipywidgets==7.7.0", + "lmfit==1.0.3", + "matplotlib==3.5.1", + "moviepy==1.0.3", + "numpy==1.22.3", + "pandas==1.4.1", + "pillow==9.0.1", + "pyqt5==5.15.6", + "pyyaml==6.0", + "scikit-image==0.19.2", + "scipy==1.8.0", + "silx==1.0.0", + "tables==3.7.0", + "traits==6.3.2", + "vtk==9.1.0", + "xrayutilities==1.7.3", ], extras_require={ "doc": [ - "sphinx", - "sphinxcontrib-mermaid", + "sphinx==4.4.0", + "sphinxcontrib-mermaid==0.7.1", ], "dev": [ - "black", - "coverage", - "doit", - "mypy", - "pycodestyle", - "pydocstyle", - "pyfakefs", - "twine", - "wheel", + "black==22.1.0", + "coverage==6.3.2", + "doit==0.34.2", + "mypy==0.941", + "pycodestyle==2.8.0", + "pydocstyle==6.1.1", + "pyfakefs==4.5.6", + "twine==3.8.0", + "wheel==0.37.1", ], }, classifiers=[ @@ -183,8 +183,6 @@ # that you indicate whether you support Python 2, Python 3 or both. # These classifiers are *not* checked by 'pip install'. See instead # 'python_requires' below. - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Operating System :: OS Independent",