Skip to content

Commit

Permalink
MAINT: Ensure sdist works (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Apr 25, 2022
1 parent bd0d627 commit ee19ca2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/test_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,28 @@ 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 .
- name: Test
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:
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include requirements.txt
2 changes: 1 addition & 1 deletion eeglabio/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The version number."""

__version__ = '0.0.1-6'
__version__ = '0.0.1-7'
10 changes: 5 additions & 5 deletions eeglabio/tests/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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",
Expand Down

0 comments on commit ee19ca2

Please sign in to comment.