Skip to content

Commit

Permalink
Merge pull request #35 from Kvieta1990/master
Browse files Browse the repository at this point in the history
add conda recipe, closes #30
  • Loading branch information
marshallmcdonnell authored Dec 29, 2020
2 parents a61599c + 9832491 commit 53cd137
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
language: python
python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'
install:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- python setup.py install
- pip install tox-travis
script:
- tox
- flake8 . --count
after_success:
- codecov
deploy:
Expand Down
42 changes: 42 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{% set data = load_setup_py() %}

package:
name: pystog
version: "{{ data['version'] }}"

source:
path: ..

build:
noarch: python
string: py{{py}}
script: python setup.py install --single-version-externally-managed --record=record.txt

requirements:
build:
- matplotlib
- numpy
- pandas
run:
- matplotlib
- numpy
- pandas

test:
imports:
- pystog
- pystog.converter.Converter
- pystog.transformer.Transformer
- pystog.fourier_filter.FourierFilter

about:
home: https://github.com/neutrons/pystog
license: GPL (version 3)
license_family: GPL3
license_file:
summary: "Transforms reciprocal and real space total scattering functions"

extra:
recipe-maintainers:
- Kvieta1990
- marshallmcdonnell
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mock
pytest
flake8
9 changes: 3 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
matplotlib==2.2.3
mock==2.0.0
numpy==1.15.4
pandas==0.23.4
pytest==4.2.1
six==1.11.0
matplotlib==3.3.3
numpy==1.19.4
pandas>=1.1
57 changes: 44 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,66 @@
import os
import setuptools
import versioneer

# Constants
THIS_DIR = os.path.dirname(__file__)

# Package description
with open("README.md", "r") as fh:
long_description = fh.read()


# Package requirements helper
def read_requirements_from_file(filepath):
'''Read a list of requirements from the given file and split into a
list of strings. It is assumed that the file is a flat
list with one requirement per line.
:param filepath: Path to the file to read
:return: A list of strings containing the requirements
'''
with open(filepath, 'rU') as req_file:
return req_file.readlines()


setup_args = dict(
install_requires=read_requirements_from_file(
os.path.join(
THIS_DIR,
'requirements.txt')),
tests_require=read_requirements_from_file(
os.path.join(
THIS_DIR,
'requirements-dev.txt')))

authors = [
'Marshall McDonnell (marshallmcdonnell)',
'Mathieu Doucet (mdoucet)',
'Ross Whitfield (rosswhitfield)',
'Pete Peterson (peterfpeterson)',
'Yuanpeng Zhang (Kvieta1990)',
]

setuptools.setup(
name="pystog",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="Marshall McDonnell",
author=",".join(authors),
author_email="mcdonnellmt@ornl.gov",
description="Transforms reciprocal and real space function",
url="https://github.com/neutrons/pystog",
description="Transforms reciprocal and real space total scattering functions",
long_description_content_type="text/markdown",
url="https://github.com/marshallmcdonnell/pystog",
license="GPL License (version 3)",
packages=setuptools.find_packages(exclude=["fortran"]),
package_data={'': ['*.dat', '*.gr']},
setup_requires=[],
install_requires=setup_args['install_requires'],
tests_require=setup_args['install_requires'] + setup_args['tests_require'],
test_suite='tests',
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
setup_requires=[
"matplotlib",
"numpy",
"pandas"
],
install_requires=[
"matplotlib",
"numpy",
"pandas"
],
entry_points={
'console_scripts': [
"pystog_cli = pystog.cli:pystog_cli",
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# General utility functions


def multiplied_template(l):
return ('%f ' * len(l))[:-1] % tuple(l)
def multiplied_template(num):
return ('%f ' * len(num))[:-1] % tuple(num)

# Test data utility functions

Expand Down

0 comments on commit 53cd137

Please sign in to comment.