Skip to content

Commit

Permalink
Adds setup.py and moves instrument and static folders into package (#150
Browse files Browse the repository at this point in the history
)
  • Loading branch information
StephenNneji authored May 2, 2024
1 parent 67f4104 commit 62b132e
Show file tree
Hide file tree
Showing 184 changed files with 66 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ htmlcov/
.cache/

# Build

_build
build/
dist/
docs/.buildinfo
docs/*.inv
installer/bundle/
Expand All @@ -24,5 +25,5 @@ installer/linux/*.run
installer/windows/*.exe
installer/windows/*.nsh
installer/macos/*.dmg

*.egg-info/
**/.DS_Store
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.md LICENSE
exclude tests/*
recursive-include static *
recursive-include instrument *
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ In addition to other things, it provides a new UI, improved simulation speed and

Installation
------------
The code is currently known to run on Windows, and Linux; it has not been tested on Mac. Installers are available on the
[release](https://github.com/ISISNeutronMuon/SScanSS-2/releases) page. It should be noted that while the code is
Installers are available on the [release](https://github.com/ISISNeutronMuon/SScanSS-2/releases) page. It should be noted that while the code is
Python 3 compatible, a single version will be tested for each release to ensure a consistent experience for all users.
The supported version for the next release is Python 3.10.

Expand Down
10 changes: 5 additions & 5 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def compile_log_config_and_schema():
"""Writes log and instrument schema json into a python file as dictionaries"""
config_data_path = PROJECT_PATH / 'sscanss' / '__config_data.py'

with open(PROJECT_PATH / 'logging.json', 'r') as log_file:
with open(PROJECT_PATH / 'sscanss' / 'logging.json', 'r') as log_file:
log_config = json.loads(log_file.read())

with open(PROJECT_PATH / 'instrument_schema.json', 'r') as schema_file:
with open(PROJECT_PATH / 'sscanss' / 'instrument_schema.json', 'r') as schema_file:
schema = json.loads(schema_file.read())

with open(config_data_path, 'w') as f:
Expand Down Expand Up @@ -208,14 +208,14 @@ def build_sscanss():

# Copy resources into installer directory
style_sheet = 'static/mac_style.css' if IS_MAC else 'static/style.css'
resources = ['instruments', 'static/images', 'static/dark_theme.css', style_sheet, 'LICENSE']

resources = ['instruments', 'static/images', 'static/dark_theme.css', style_sheet]
shutil.copy(PROJECT_PATH / 'LICENSE', dist_path / 'LICENSE')
for resource in resources:
if IS_MAC:
dest_path = dist_path / 'sscanss.app' / 'Contents' / 'Resources' / resource
else:
dest_path = dist_path / resource
src_path = PROJECT_PATH / resource
src_path = PROJECT_PATH / 'sscanss' / resource
if src_path.is_file():
shutil.copy(src_path, dest_path)
else:
Expand Down
52 changes: 52 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from setuptools import setup, find_packages
from sscanss.__version import __version__


setup(
name='sscanss',
version=str(__version__),
author='',
author_email='',
url='https://github.com/ISISNeutronMuon/SScanSS-2',
description='A virtual laboratory for planning strain scanning experiments on engineering beam-line instruments',
long_description=open('README.md', encoding='utf8').read(),
packages=find_packages(exclude=["tests"]),
include_package_data=True,
package_data={'': ['*.json', 'static/*', 'static/images/**/*', 'instruments/**/*', 'instruments/**/**/*']},
python_requires='>=3.9',
install_requires=['bitarray',
'cython',
'h5py',
'jsbeautifier',
'jsonschema',
'matplotlib',
'NLopt',
'numpy',
'gimpact',
'Pillow',
'PyInstaller',
'PyOpenGL',
'PyQt6',
'pystache',
'PyQt6-QScintilla',
'scipy',
'tifffile',
'psutil',
],
classifiers=['Programming Language :: Python :: 3.10',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Intended Audience :: Science/Research',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Topic :: Scientific/Engineering',
],
entry_points={
'console_scripts': [
'sscanss = sscanss.app.main:main',
'sscanss-editor = sscanss.editor.main:main'
],
},
zip_safe=False,
)
2 changes: 1 addition & 1 deletion sscanss/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from sscanss.__config_data import LOG_CONFIG, SCHEMA
INSTRUMENT_SCHEMA = SCHEMA
else:
SOURCE_PATH = pathlib.Path(__file__).parent.parent
SOURCE_PATH = pathlib.Path(__file__).parent
with open(SOURCE_PATH / "logging.json", "r") as log_file:
LOG_CONFIG = json.loads(log_file.read())

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit 62b132e

Please sign in to comment.