Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Changes to release v0.4.1 on PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
pafonta committed Jan 31, 2018
1 parent 0f11f62 commit cdbc5f0
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 136 deletions.
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

118 changes: 61 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[Getting started](#getting-started) |
[Getting Started](#getting-started) |
[Releases](#releases) |
[Status](#status) |
[Requirements: macOS](#macos) |
[Requirements: Ubuntu](#ubuntu) |
[Packaging](#packaging)
[Status](#status)

# NeuroCurator

Desktop application to perform systematic and collaborative curation of neuroscientific literature.
Desktop application to perform systematic and collaborative curation of
neuroscientific literature.

This is a Graphical User Interface (GUI) for the Python package [NeuroAnnotation Toolbox (NAT)](https://github.com/BlueBrain/nat).
This is a Graphical User Interface (GUI) for the Python package
[NeuroAnnotation Toolbox (NAT)](https://github.com/BlueBrain/nat).

This framework has been described in details in the following open-access paper: https://doi.org/10.3389/fninf.2017.00027.
This framework has been described in details in the following open-access
paper: https://doi.org/10.3389/fninf.2017.00027.

With NeuroCurator, annotations are:
- traceable,
Expand All @@ -20,74 +20,78 @@ With NeuroCurator, annotations are:

---

## Getting started
## Getting Started

Install the [requirements](#requirements).
**Requirements:**

Download the packaged executable of the [latest release](https://github.com/BlueBrain/neurocurator/releases/latest).
System side:

Launch NeuroCurator:
```
./neurocurator_<version>_<operating system>_x64
```
(in the folder where you downloaded the file)

## Releases

In the [dedicated section](https://github.com/BlueBrain/neurocurator/releases/), you can find:
- the latest version,
- the notable changes of each version,
- the packaged executables for macOS and Ubuntu.

## Status

Created during 2016.

Ongoing reengineering in the branch _refactor-architecture_.

The branch _refactor-architecture_ is **not** intended to be used by end-users.

New features, bug fixes and improvements are done on the reengineered code sections.
- [Git 1.7.0+](https://git-scm.com/downloads)
- [ImageMagick 6](http://docs.wand-py.org/en/latest/guide/install.html)
- [Python 3.4*](https://www.python.org/downloads/)
- [Qt 4.8.7*](https://doc.qt.io/archives/qt-4.8/supported-platforms.html)
- [Miniconda*](https://conda.io/miniconda.html)

When a reengineered code section is stable, it's merged into the branch _master_ and a release is published.
Python side:

## Requirements
- [NAT](https://github.com/BlueBrain/nat)
- [PySide 1.2.4](https://wiki.qt.io/PySide)
- [NumPy](http://www.numpy.org)
- [pandas](https://pandas.pydata.org)
- [Wand](http://docs.wand-py.org)

### macOS
*Miniconda is not required. It simplifies only temporary the installation:
no need to compile Qt and to install manually Python 3.4.

Work on El Capitan (10.11.x) and higher.
**Installation:**

The packaged executable needs [Git](https://git-scm.com) and [ImageMagick](https://www.imagemagick.org) **6**.

ImageMagick 6 can be installed with [Homebrew](https://brew.sh):
```
brew install imagemagick@6
brew link imagemagick@6 --force
Create a virtual environment with Python 3.4:
```bash
conda create -y --name nc python=3.4
```

Git can also be installed with Homebrew:
Switch to the virtual environment:
```bash
source activate nc
```
brew install git

Install PySide 1.2.4 and Qt 4.8.7 from [conda-forge](https://conda-forge.org):
```bash
conda install -y pyside --channel conda-forge
```

You might require to allow execution:
Install NeuroCurator:
```bash
pip install nat
pip install neurocurator --no-deps
```
sudo chmod u+x neurocurator_<version>_mac_x64

Launch NeuroCurator:
```bash
neurocurator
```

### Ubuntu
For the future uses:
1. enter the virtual environment: `source activate nc`
2. launch NeuroCurator: `neurocurator`
3. use NeuroCurator
4. close NeuroCurator
5. exit the virtual environment: `source deactivate`

Should work on 16.04.x LTS (Xenial) and higher, and also on other Debian-based distributions.
## Releases

The packaged executable needs [Git](https://git-scm.com):
```
sudo apt install git
```
Versions and their notable changes are listed in the
[releases section](https://github.com/BlueBrain/neurocurator/releases/).

## Status

## Packaging
Created during 2016.

The code from the branch _master_ of NeuroCurator and [NAT](https://github.com/BlueBrain/nat) is used.
Ongoing stabilization and reengineering in the branch _refactor-architecture_.

The packaged executables of NeuroCurator are created on up-to-date 64 bits OS X El Capitan and Ubuntu 16.04 LTS systems.
The branch _refactor-architecture_ is **not** intended to be used by end-users.

New features, bug fixes and improvements are done on the reengineered code sections.

NeuroCurator's configuration is stored in a *settings.ini* file created alongside the executable.
When a reengineered code section is stable, it's merged into the branch
_master_ and a release is published.
6 changes: 5 additions & 1 deletion neurocurator/main.py → neurocurator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
from neurocurator.mainWin import Window


if __name__ == '__main__':
def main():
app = QApplication(sys.argv)
window = Window()
# FIXME DEBUG.
# window.setGeometry(0, 0, 500, 1424)
# /FIXME DEBUG.
window.show()
sys.exit(app.exec_())


if __name__ == "__main__":
main()
6 changes: 3 additions & 3 deletions neurocurator/mainWin.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from nat.restClient import RESTClient, RESTImportPDFErr
from nat.tag import Tag
from nat.utils import Id2FileName # , fileName2Id
from neurocurator import utils
from neurocurator.utils import package_directory
from neurocurator.zotero_widget import ZoteroTableWidget
from requests.exceptions import ConnectionError
from .addOntoTermDlg import AddOntoTermDlg
Expand Down Expand Up @@ -374,10 +374,10 @@ def setupWindowsUI(self) :

# FIXME Delayed refactoring. Do settings management with QSettings.
zotero_settings = self.settings.config["ZOTERO"]
work_dir = utils.working_directory()
directory = package_directory()

# NB: Don't specify a parent for widgets to be added to a QTabWidget.
self.zotero_widget = ZoteroTableWidget(zotero_settings, work_dir, self.checkIdInDB, self.dbPath, self)
self.zotero_widget = ZoteroTableWidget(zotero_settings, directory, self.checkIdInDB, self.dbPath, self)

self.zotero_widget.view.doubleClicked.connect(self.changeTagToAnnotations)

Expand Down
6 changes: 3 additions & 3 deletions neurocurator/settingsDlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from PySide import QtGui, QtCore

from neurocurator import utils
from neurocurator.utils import package_directory


def getSettings(popDialog = False):
Expand All @@ -29,7 +29,7 @@ def popDialogFct():


class Settings:
fileName = os.path.join(utils.working_directory(), 'settings.ini')
fileName = os.path.join(package_directory(), 'settings.ini')
def __init__(self):
self.config = configparser.ConfigParser()
with open(Settings.fileName) as configfile: # Raise an exception if file does not exist
Expand Down Expand Up @@ -114,7 +114,7 @@ def writeConfig(self):

config = self.projectSettings.writeConfig(config)

with open(os.path.join(utils.working_directory(), 'settings.ini'), 'w') as configfile:
with open(os.path.join(package_directory(), 'settings.ini'), 'w') as configfile:
config.write(configfile)

self.accept()
Expand Down
10 changes: 3 additions & 7 deletions neurocurator/utils.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
__author__ = "Pierre-Alexandre Fonta"

import os
import sys

from PySide.QtCore import Qt
from PySide.QtGui import QFormLayout


def working_directory():
"""Return the working directory according to it being bundled/frozen."""
if getattr(sys, 'frozen', False):
return os.path.dirname(sys.executable)
else:
return os.path.dirname(__file__)
def package_directory():
"""Return the absolute path to the directory containing the package files."""
return os.path.abspath(os.path.dirname(__file__))


def configure_form_layout(form_layout):
Expand Down
4 changes: 2 additions & 2 deletions neurocurator/zotero_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class ZoteroTableWidget(QWidget):

def __init__(self, settings, work_dir, check_id_fct, annotations_path, parent=None):
def __init__(self, settings, directory, check_id_fct, annotations_path, parent=None):
super().__init__(parent)
# FIXME Delayed refactoring of check_id_fct and annotations_path.

Expand All @@ -23,7 +23,7 @@ def __init__(self, settings, work_dir, check_id_fct, annotations_path, parent=No
library_id = settings["libraryID"]
library_type = settings["libraryType"]
api_key = settings["apiKey"]
self._zotero = ZoteroWrap(library_id, library_type, api_key, work_dir)
self._zotero = ZoteroWrap(library_id, library_type, api_key, directory)

# Widgets section.

Expand Down
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

109 changes: 52 additions & 57 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,64 +1,59 @@
from distutils.core import setup
__authors__ = ["Pierre-Alexandre Fonta", "Christian O'Reilly"]
__maintainer__ = "Pierre-Alexandre Fonta"

import os

PACKAGE = "neurocurator"
NAME = "neurocurator"
DESCRIPTION = open(os.path.join(os.path.dirname(__file__), "README.md")).read()
AUTHOR = "Christian O'Reilly, Pierre-Alexandre Fonta"
AUTHOR_EMAIL = "[email protected]"
VERSION = "0.4.0"
REQUIRED = ["nat", "PySide", "numpy", "parse", "metapub", "pyzotero", "GitPython",
"biopython", "beautifulsoup4", "quantities", "wand", "scipy", "pandas"]
from setuptools import setup

def is_package(path):
return (
os.path.isdir(path) and
os.path.isfile(os.path.join(path, '__init__.py'))
)
VERSION = "0.4.1"

def find_packages(path, base=""):
""" Find all packages in path """
packages = {}
for item in os.listdir(path):
dir = os.path.join(path, item)
if is_package( dir ):
if base:
module_name = "%(base)s.%(item)s" % vars()
else:
module_name = item
packages[module_name] = dir
packages.update(find_packages(dir, module_name))
return packages
HERE = os.path.abspath(os.path.dirname(__file__))

packages=find_packages(".")
# Get the long description from the README file.
# Convert to rst with: pandoc --from=markdown --to=rst README.md -o README.rst.
with open(os.path.join(HERE, "README.rst"), encoding="utf-8") as f:
long_description = f.read()

setup(
name=NAME,
packages=packages.keys(),
package_dir=packages,
version=VERSION,
description=DESCRIPTION,
long_description=DESCRIPTION, #open("README.txt").read(),
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=AUTHOR,
maintainer_email=AUTHOR_EMAIL,
license='LICENSE.txt',
requires=REQUIRED,
install_requires=REQUIRED,
url="https://github.com/christian-oreilly/neurocurator",
classifiers=["Development Status :: 3 - Alpha",
"Environment :: MacOS X", #"Environment :: Win32 (MS Windows)",
"Environment :: X11 Applications",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: Free for non-commercial use",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Programming Language :: Python :: 3.4",
"Topic :: Scientific/Engineering"])





name="neurocurator",
version=VERSION,
description="Application to perform curation of neuroscientific literature.",
long_description=long_description,
keywords="neuroscience annotation curation literature modeling parameters",
url="https://github.com/BlueBrain/neurocurator",
author="Christian O'Reilly, Pierre-Alexandre Fonta",
author_email="[email protected], [email protected]",
# NB: 'If maintainer is provided, distutils lists it as the author in PKG-INFO'.
# https://docs.python.org/3/distutils/setupscript.html#meta-data
# maintainer="Pierre-Alexandre Fonta",
# maintainer_email="[email protected]",
license="GPLv3",
packages=["neurocurator"],
python_requires="~=3.4.0", # Until #6 is solved.
install_requires=[
"nat==" + VERSION,
"pyside",
"numpy",
"pandas",
"wand"
],
data_files=[("", ["LICENSE.txt"])],
entry_points={
# NB: gui_scripts: on Windows no console is attached (no stdout/stderr).
"console_scripts": ["neurocurator = neurocurator.__main__:main"]
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Environment :: X11 Applications :: Qt",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"License :: Free for non-commercial use",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.4",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Natural Language :: English"
]
)
1 change: 0 additions & 1 deletion upload2pypi.sh

This file was deleted.

0 comments on commit cdbc5f0

Please sign in to comment.