-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Build pyproj toml #948
Open
asoplata
wants to merge
6
commits into
jonescompneurolab:master
Choose a base branch
from
brown-ccv:build-pyproj-toml
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fc642a0
build: update pyproject.toml
gtdang 28b9c33
build: update pyproject.toml
gtdang 048aab1
build: update manifest
gtdang 165b44e
build: update pyproject.toml
gtdang 104cf3e
build: simplify setup.py
gtdang 81dd57a
build: remove mpi4py from parallel opt-dependency
gtdang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,69 @@ | ||
[build-system] | ||
requires = ["setuptools>=40.8.0", "NEURON >=7.7; platform_system != 'Windows'"] | ||
build-backend = "setuptools.build_meta:__legacy__" | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "hnn-core" | ||
dynamic = ["version"] | ||
authors = [ | ||
{ name="Mainak Jas", email="[email protected]" }, | ||
{ name="Nicholas Tolley", email="[email protected]" }, | ||
{ name="Ryan Thorpe", email="[email protected]" }, | ||
{ name="Stephanie Jones", email="[email protected]" }, | ||
] | ||
maintainers = [ | ||
{name="George Dang", email="[email protected]"}, | ||
{name="Dylan Daniels", email="[email protected]"}, | ||
] | ||
description = "Tools for biophysical simulation of a cortical column using Neuron" | ||
readme = "README.rst" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: BSD (3-clause)", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development", | ||
"Topic :: Scientific/Engineering", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix", | ||
"Operating System :: MacOS", | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"numpy >= 1.14", | ||
"matplotlib >= 3.5.3", | ||
"scipy", | ||
"NEURON >= 7.7; sys_platform != 'win32'", | ||
"h5io", | ||
] | ||
|
||
[project.optional-dependencies] | ||
opt = ['scikit-learn'] | ||
test = ['flake8', 'pytest', 'pytest-cov'] | ||
docs = [ | ||
'mne', 'nibabel', 'pooch', 'tdqm', 'sphinx', | ||
'sphinx-gallery', 'sphinx_bootstrap_theme', 'sphinx-copybutton', | ||
'pillow', 'numpydoc', | ||
] | ||
parallel = ['joblib', 'psutil'] | ||
gui = ['ipywidgets>=8.0.0', 'ipykernel', 'ipympl', 'voila'] | ||
dev = ["hnn-core[opt,test,docs,parallel,gui]"] | ||
|
||
[project.gui-scripts] | ||
hnn-gui = "hnn_core.gui.gui:launch" | ||
|
||
[project.urls] | ||
"Homepage" = "https://jonescompneurolab.github.io/hnn-core" | ||
"Source Code" = "http://github.com/jonescompneurolab/hnn-core" | ||
|
||
[tool.setuptools] | ||
packages = ["hnn_core"] | ||
include-package-data = true | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "hnn_core.__version__"} | ||
|
||
[tool.codespell] | ||
skip = '.git,*.pdf,*.svg' | ||
check-hidden = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,18 @@ | ||
#! /usr/bin/env python | ||
import platform | ||
import os.path as op | ||
import os | ||
import subprocess | ||
import shutil | ||
|
||
from setuptools import setup, find_packages, Command | ||
from setuptools import setup, Command | ||
from setuptools.command.build_py import build_py | ||
|
||
descr = """Code for biophysical simulation of a cortical column using Neuron""" | ||
|
||
DISTNAME = 'hnn-core' | ||
DESCRIPTION = descr | ||
MAINTAINER = 'Mainak Jas' | ||
MAINTAINER_EMAIL = '[email protected]' | ||
URL = '' | ||
LICENSE = 'BSD (3-clause)' | ||
DOWNLOAD_URL = 'http://github.com/jonescompneurolab/hnn-core' | ||
|
||
# get the version | ||
version = None | ||
with open(os.path.join('hnn_core', '__init__.py'), 'r') as fid: | ||
for line in (line.strip() for line in fid): | ||
if line.startswith('__version__'): | ||
version = line.split('=')[1].strip().strip('\'') | ||
break | ||
if version is None: | ||
raise RuntimeError('Could not determine version') | ||
|
||
|
||
# test install with: | ||
# test the build of wheel and sdist: | ||
# First remove residual mod files | ||
# $ rm -rf hnn_core/mod/x86_64/ | ||
# $ python setup.py clean --all install | ||
# | ||
# to make sure there are no residual mod files | ||
# or for Apple silicon | ||
# $ rm -rf hnn_core/mod/mod64/ | ||
# $ python -m build | ||
# | ||
# also see following link to understand why build_py must be overridden: | ||
# https://stackoverflow.com/questions/51243633/python-setuptools-setup-py-install-does-not-automatically-call-build | ||
|
@@ -72,59 +51,5 @@ def run(self): | |
|
||
build_py.run(self) | ||
|
||
setup(cmdclass={'build_py': build_py_mod, 'build_mod': BuildMod}) | ||
|
||
if __name__ == "__main__": | ||
extras = { | ||
'opt': ['scikit-learn'], | ||
'parallel': ['joblib', 'psutil'], | ||
'test': ['flake8', 'pytest', 'pytest-cov', ], | ||
'docs': ['mne', 'nibabel', 'pooch', 'tdqm', | ||
'sphinx', 'sphinx-gallery', | ||
'sphinx_bootstrap_theme', 'sphinx-copybutton', | ||
'pillow', 'numpydoc', | ||
], | ||
'gui': ['ipywidgets>=8.0.0', 'ipykernel', 'ipympl', 'voila', ], | ||
} | ||
extras['dev'] = (extras['opt'] + extras['parallel'] + extras['test'] + | ||
extras['docs'] + extras['gui'] | ||
) | ||
|
||
|
||
setup(name=DISTNAME, | ||
maintainer=MAINTAINER, | ||
maintainer_email=MAINTAINER_EMAIL, | ||
description=DESCRIPTION, | ||
license=LICENSE, | ||
url=URL, | ||
version=version, | ||
download_url=DOWNLOAD_URL, | ||
long_description=open('README.rst').read(), | ||
classifiers=[ | ||
'Intended Audience :: Science/Research', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved', | ||
'Programming Language :: Python', | ||
'Topic :: Software Development', | ||
'Topic :: Scientific/Engineering', | ||
'Operating System :: Microsoft :: Windows', | ||
'Operating System :: POSIX', | ||
'Operating System :: Unix', | ||
'Operating System :: MacOS', | ||
], | ||
platforms='any', | ||
install_requires=[ | ||
'numpy >=1.14', | ||
'NEURON >=7.7; platform_system != "Windows"', | ||
'matplotlib>=3.5.3', | ||
'scipy', | ||
'h5io' | ||
], | ||
extras_require=extras, | ||
python_requires='>=3.8', | ||
packages=find_packages(), | ||
package_data={'hnn_core': [ | ||
'param/*.json', | ||
'gui/*.ipynb']}, | ||
cmdclass={'build_py': build_py_mod, 'build_mod': BuildMod}, | ||
entry_points={'console_scripts': ['hnn-gui=hnn_core.gui.gui:launch']} | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this actually work? I suspect it will break ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the documentation on specifying dynamic metadata. I think it should work, it's pretty commonplace with toml specification. Just need the version defined in the top-level
__init__.py
in the package.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try ... I think
hnn_core.__version__
is not defined before installation. Maybe it works !