Skip to content

Commit

Permalink
Altered for package release
Browse files Browse the repository at this point in the history
  • Loading branch information
sivart213 committed May 2, 2024
1 parent c06cce7 commit fc0c432
Show file tree
Hide file tree
Showing 18 changed files with 2,656 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: 2
jobs:
build:
docker:
- image: continuumio/miniconda3

working_directory: ~/repo

steps:
- checkout


# - restore_cache:
# keys:
# - v1-dependencies-{{ checksum "environment.yml" }}
# - v1-dependencies-


- run:
name: install dependencies
command: |
# conda env create -q || conda env update -q
# source activate adj
conda install -qy conda-build anaconda-client pytest pytest-cov
conda config --set auto_update_conda no
conda info -a
conda build conda.recipe --no-test
conda install --use-local research_tools
# - save_cache:
# paths:
# - /opt/conda
# key: v1-dependencies-{{ checksum "environment.yml" }}


- run:
name: run tests
command: |
# source activate adj
pytest --color=yes -v --cov=research_tools tests
conda install -c conda-forge codecov
codecov
- store_artifacts:
path: test-reports
destination: test-reports
8 changes: 8 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
exclude_paths:
- 'research_tools/_version.py'
- 'tests/**/*'
- 'tests/*'
- 'benchmarks/**/*'
- 'setup.py'
- 'versioneer.py'
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[report]
omit =
setup.py
research_tools/__main__.py
research_tools/_version.py
versioneer.py
tests/*
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
research_tools/_version.py export-subst
* text=auto eol=lf
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Config file for automatic testing at travis-ci.org

language: python
python:
- "2.7"
- "3.6"

install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes
- conda update -q conda
- conda install conda-build anaconda-client pytest pytest-cov
- conda config --set auto_update_conda no
- conda build conda.recipe --no-test
- conda install --use-local research_tools
- conda info -a
script:
- pytest -v --color=yes --cov=research_tools tests
after_success:
- conda install -c conda-forge codecov
- codecov
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include versioneer.py
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
===============================
research_tools
===============================


.. image:: https://img.shields.io/travis/sivart213/research_tools.svg
:target: https://travis-ci.org/sivart213/research_tools
.. image:: https://circleci.com/gh/sivart213/research_tools.svg?style=svg
:target: https://circleci.com/gh/sivart213/research_tools
.. image:: https://codecov.io/gh/sivart213/research_tools/branch/master/graph/badge.svg
:target: https://codecov.io/gh/sivart213/research_tools


Container for functions and equations
55 changes: 55 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\tools\\appveyor\\run_with_env.cmd"

matrix:
- PYTHON: "C:\\Miniconda36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Miniconda-x64"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "64"

init:
- ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH% %HOME%


install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# these correspond to folder naming of miniconda installs on appveyor. See
# https://www.appveyor.com/docs/installed-software#python
- if "%PYTHON_VERSION%" == "3.6" set "BASE_PYTHON_VERSION=36"
- if "%PYTHON_ARCH%" == "64" set "ARCH_LABEL=-x64"
- call "C:\Miniconda%BASE_PYTHON_VERSION%%ARCH_LABEL%\Scripts\activate.bat"
- conda config --set always_yes yes
- conda update -q conda
- conda config --set auto_update_conda no
- conda update -q --all
- conda install -q pytest pytest-cov conda-build anaconda-client
- conda info
# this is to ensure dependencies
- conda build conda.recipe --no-test
- conda install --use-local research_tools


# Not a .NET project, we build package in the install step instead
build: false

test_script:
- py.test --color=yes -v --cov research_tools --cov-report xml tests

on_success:
- conda install -c conda-forge codecov
- codecov --env PYTHON_VERSION --file C:\projects\research_tools\coverage.xml
52 changes: 52 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{% set data = load_setup_py_data() %}

package:
name: research-tools
version: {{ data['version'] }}

source:
path: ..

build:
# If the installation is complex, or different between Unix and Windows, use
# separate bld.bat and build.sh files instead of this key. Add the line
# "skip: True # [py<35]" (for example) to limit to Python 3.5 and newer, or
# "skip: True # [not win]" to limit to Windows.
script: {{ PYTHON }} -m pip install --no-deps --ignore-installed -vv .
noarch: python

entry_points:
{% for entry in data['entry_points']['console_scripts'] %}
- {{ entry.split('=')[0].strip() }} = {{ entry.split('=')[1].strip() }}
{% endfor %}


requirements:
# if you need compilers, uncomment these
# read more at https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html
# build:
# - {{ compilers('c') }}
host:
- python
- pip
run:
- python
# dependencies are defined in setup.py
{% for dep in data['install_requires'] %}
- {{ dep.lower() }}
{% endfor %}

test:
source_files:
- tests
requires:
- pytest
- pytest-cov
commands:
- pytest

about:
home: https://github.com/sivart213/research_tools
summary: Container for functions and equations
license: {{ data.get('license') }}
license_file: LICENSE
3 changes: 3 additions & 0 deletions research_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
@author: j2cle
"""
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

from .equations.general import (
arc,
Expand Down
3 changes: 3 additions & 0 deletions research_tools/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from research_tools import cli

cli.cli()
Loading

0 comments on commit fc0c432

Please sign in to comment.