diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml index c4240a7..acd57ba 100644 --- a/.github/workflows/test_publish.yml +++ b/.github/workflows/test_publish.yml @@ -27,8 +27,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install mne flake8 pytest + pip install mne flake8 pytest twine pymatreader pip install -r requirements.txt + pip install -e . + mne sys_info -d + shell: bash -el {0} - name: Lint run: | flake8 . @@ -36,10 +39,16 @@ jobs: run: | pytest - name: Build Package - if: github.event_name == 'push' && (github.ref == 'refs/heads/stable' || startsWith(github.ref, 'refs/tags/v')) run: | pip install setuptools wheel twine python setup.py sdist bdist_wheel + shell: bash -el {0} + - name: Test sdist + run: | + twine check dist/* + ls dist/*.tar.gz | wc -l | grep "^1$" + pip install dist/*.tar.gz + shell: bash -el {0} - name: Publish to Test PyPI if: github.event_name == 'push' && github.ref == 'refs/heads/stable' env: diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..f9bd145 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include requirements.txt diff --git a/eeglabio/_version.py b/eeglabio/_version.py index fe7968a..48405a8 100644 --- a/eeglabio/_version.py +++ b/eeglabio/_version.py @@ -1,3 +1,3 @@ """The version number.""" -__version__ = '0.0.1-6' +__version__ = '0.0.1-7' diff --git a/eeglabio/tests/test_raw.py b/eeglabio/tests/test_raw.py index 85c5cec..9ee6794 100644 --- a/eeglabio/tests/test_raw.py +++ b/eeglabio/tests/test_raw.py @@ -12,14 +12,14 @@ def test_export_set(tmpdir): """Test saving a Raw instance to EEGLAB's set format""" - raw = read_raw_fif(raw_fname) - raw.load_data() + raw = read_raw_fif(raw_fname).pick_types( + meg=True, eeg=True, ecg=True).load_data() temp_fname = op.join(str(tmpdir), 'test_raw.set') export_mne_raw(raw, temp_fname) raw_read = read_raw_eeglab(temp_fname, preload=True) assert raw.ch_names == raw_read.ch_names cart_coords = np.array([d['loc'][:3] for d in raw.info['chs']]) # just xyz cart_coords_read = np.array([d['loc'][:3] for d in raw_read.info['chs']]) - assert_allclose(cart_coords, cart_coords_read) - assert_allclose(raw.times, raw_read.times) - assert_allclose(raw.get_data(), raw_read.get_data()) + assert_allclose(cart_coords, cart_coords_read, atol=1e-5) + assert_allclose(raw.times, raw_read.times, atol=1e-5) + assert_allclose(raw.get_data(), raw_read.get_data(), atol=1e-11) diff --git a/setup.py b/setup.py index d02b727..180013d 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ version = line.split('=')[1].strip().strip("'") break if version is None: - version = "0.0.1" + raise RuntimeError('Could not obtain version') with open("requirements.txt") as f: requires = f.read().splitlines() @@ -38,7 +38,7 @@ "Operating System :: OS Independent", ], packages=setuptools.find_packages(exclude=("*tests",)), - python_requires=">=3.6", + python_requires=">=3.7", include_package_data=True, install_requires=requires, keywords="EEG MEG MNE EEGLAB",