Skip to content

Commit

Permalink
Drop Python 3.6 and 3.7 support (ME-ICA#40)
Browse files Browse the repository at this point in the history
* Drop Python 3.6 and 3.7 support.

* line_terminator --> lineterminator
  • Loading branch information
tsalo authored Apr 26, 2023
1 parent b06f65a commit 29eee66
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 84 deletions.
103 changes: 33 additions & 70 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,26 @@ orbs:
codecov: codecov/codecov@1.0.5
jobs:

makeenv_37:
makeenv_38:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/tedana
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Generate environment
command: |
if [ ! -d /opt/conda/envs/tedana_py37 ]; then
conda create -yq -n tedana_py37 python=3.7
source activate tedana_py37
if [ ! -d /opt/conda/envs/tedana_py38 ]; then
conda create -yq -n tedana_py38 python=3.8
source activate tedana_py38
pip install -e .[tests]
fi
- save_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
paths:
- /opt/conda/envs/tedana_py37

unittest_37:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/tedana
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
- run:
name: Running unit tests
command: |
apt-get update
apt-get install -y make
source activate tedana_py37 # depends on makeenv_37
make unittest
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.py37
- persist_to_workspace:
root: /tmp
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
paths:
- src/coverage/.coverage.py37
- /opt/conda/envs/tedana_py38

unittest_38:
docker:
Expand All @@ -58,27 +36,15 @@ jobs:
- checkout
- restore_cache:
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Generate environment
command: |
apt-get update
apt-get install -yqq make
if [ ! -d /opt/conda/envs/tedana_py38 ]; then
conda create -yq -n tedana_py38 python=3.8
source activate tedana_py38
pip install .[tests]
fi
- run:
name: Running unit tests
command: |
source activate tedana_py38
apt-get update
apt-get install -y make
source activate tedana_py38 # depends on makeenv_38
make unittest
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.py38
- save_cache:
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
paths:
- /opt/conda/envs/tedana_py38
- persist_to_workspace:
root: /tmp
paths:
Expand Down Expand Up @@ -152,21 +118,20 @@ jobs:
paths:
- src/coverage/.coverage.py310


style_check:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/tedana
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Style check
command: |
apt-get update
apt-get install -yqq make
source activate tedana_py37 # depends on makeenv37
source activate tedana_py38 # depends on makeenv38
make lint
three-echo:
Expand All @@ -176,14 +141,14 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Run integration tests
no_output_timeout: 40m
command: |
apt-get update
apt-get install -yqq make
source activate tedana_py37 # depends on makeenv_37
source activate tedana_py38 # depends on makeenv_38
make three-echo
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.three-echo
Expand All @@ -201,14 +166,14 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Run integration tests
no_output_timeout: 40m
command: |
apt-get update
apt-get install -yqq make
source activate tedana_py37 # depends on makeenv_37
source activate tedana_py38 # depends on makeenv_38
make four-echo
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.four-echo
Expand All @@ -226,14 +191,14 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Run integration tests
no_output_timeout: 40m
command: |
apt-get update
apt-get install -yqq make
source activate tedana_py37 # depends on makeenv_37
source activate tedana_py38 # depends on makeenv_38
make five-echo
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.five-echo
Expand All @@ -251,14 +216,14 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Run integration tests
no_output_timeout: 40m
command: |
apt-get update
apt-get install -yqq make
source activate tedana_py37 # depends on makeenv_37
source activate tedana_py38 # depends on makeenv_38
make reclassify
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.reclassify
Expand All @@ -277,14 +242,14 @@ jobs:
steps:
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Run integration tests
no_output_timeout: 40m
command: |
apt-get update
apt-get install -yqq make
source activate tedana_py37 # depends on makeenv_37
source activate tedana_py38 # depends on makeenv_38
make t2smap
mkdir /tmp/src/coverage
mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.t2smap
Expand All @@ -304,13 +269,13 @@ jobs:
at: /tmp
- checkout
- restore_cache:
key: conda-py37-v2-{{ checksum "pyproject.toml" }}
key: conda-py38-v2-{{ checksum "pyproject.toml" }}
- run:
name: Merge coverage files
command: |
apt-get update
apt-get install -yqq curl
source activate tedana_py37 # depends on makeenv37
source activate tedana_py38 # depends on makeenv38
cd /tmp/src/coverage/
coverage combine
coverage xml
Expand All @@ -323,34 +288,32 @@ workflows:
version: 2.1
build_test:
jobs:
- makeenv_37
- unittest_37:
- makeenv_38
- unittest_38:
requires:
- makeenv_37
- makeenv_38
- style_check:
requires:
- makeenv_37
- makeenv_38
- three-echo:
requires:
- makeenv_37
- makeenv_38
- four-echo:
requires:
- makeenv_37
- makeenv_38
- five-echo:
requires:
- makeenv_37
- makeenv_38
- reclassify:
requires:
- makeenv_37
- makeenv_38
- t2smap:
requires:
- makeenv_37
- unittest_38
- makeenv_38
- unittest_39
- unittest_310
- merge_coverage:
requires:
- unittest_37
- unittest_38
- unittest_39
- unittest_310
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile_dev
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ ENV LANG="C.UTF-8" \

RUN git clone https://github.com/me-ica/tedana.git /tedana

RUN bash -c "conda create -yq --name tedana_py36 python=3.6 pip \
&& source activate tedana_py36 \
RUN bash -c "conda create -yq --name tedana_env python=3.8 pip \
&& source activate tedana_env \
&& pip install /tedana[all] \
&& pip install ipython \
&& rm -rf ~/.cache/pip/* \
&& conda clean --all"

RUN /opt/conda/envs/tedana_py36/bin/ipython profile create \
RUN /opt/conda/envs/tedana_env/bin/ipython profile create \
&& sed -i 's/#c.InteractiveShellApp.extensions = \[\]/ \
c.InteractiveShellApp.extensions = \['\''autoreload'\''\]/g' \
/root/.ipython/profile_default/ipython_config.py
Expand All @@ -57,7 +57,7 @@ RUN mkdir -p /tedana/dev_tools

COPY ["./dev_tools", "/tedana/dev_tools"]

RUN sed -i '$isource activate tedana_py36' $ND_ENTRYPOINT
RUN sed -i '$isource activate tedana_env' $ND_ENTRYPOINT

RUN sed -i '$isource /tedana/dev_tools/run_tests.sh' $ND_ENTRYPOINT

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If you use `tedana`, please cite the following papers, as well as our [most rece
### Use `tedana` with your local Python environment

You'll need to set up a working development environment to use `tedana`.
To set up a local environment, you will need Python >=3.6 and the following packages will need to be installed:
To set up a local environment, you will need Python >=3.8 and the following packages will need to be installed:

* [numpy](http://www.numpy.org/)
* [scipy](https://www.scipy.org/)
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Installation
############

You'll need to set up a working development environment to use ``tedana``.
To set up a local environment, you will need Python >=3.6 and the following
To set up a local environment, you will need Python >=3.8 and the following
packages will need to be installed:

- nilearn
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ classifiers = [
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Information Analysis",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
license = {file = "LICENSE"}
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"bokeh<2.3.0",
"mapca>=0.0.3",
"matplotlib",
"nibabel>=2.5.1",
"nilearn>=0.7",
"numpy>=1.16",
"pandas>=0.24",
"pandas>=2.0",
"scikit-learn>=0.21",
"scipy>=1.2.0",
"threadpoolctl",
Expand Down
8 changes: 4 additions & 4 deletions tedana/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,10 @@ def save_tsv(self, data, name):
data_type = type(data)
if not isinstance(data, pd.DataFrame):
raise TypeError(f"data must be pd.Data, not type {data_type}.")
if versiontuple(pd.__version__) >= versiontuple("1.5.2"):
data.to_csv(name, sep="\t", lineterminator="\n", na_rep="n/a", index=False)
else:
data.to_csv(name, sep="\t", line_terminator="\n", na_rep="n/a", index=False)

# Replace blanks with numpy NaN
deblanked = data.replace("", np.nan)
deblanked.to_csv(name, sep="\t", lineterminator="\n", na_rep="n/a", index=False)

def save_self(self):
fname = self.save_file(self.registry, "registry json")
Expand Down

0 comments on commit 29eee66

Please sign in to comment.