Skip to content

Commit

Permalink
Merge pull request #152 from marshall-lab/develop
Browse files Browse the repository at this point in the history
v2.1.0
  • Loading branch information
s-bessey authored Jan 21, 2021
2 parents 2676ed3 + 818deff commit 2e72ca9
Show file tree
Hide file tree
Showing 53 changed files with 1,023 additions and 634 deletions.
54 changes: 0 additions & 54 deletions scripts/bs_Core.sh

This file was deleted.

49 changes: 0 additions & 49 deletions settings/nyc-msm/partnership.yml

This file was deleted.

73 changes: 73 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import setuptools
import subprocess

# ========= FROM https://github.com/vivin/better-setuptools-git-version/blob/master/better_setuptools_git_version.py with edits =========
def get_latest_tag():
return subprocess.getoutput(
"git describe --tags `git rev-list --tags --max-count=1`"
)


def get_tag_commit_sha(tag):
"""Return the commit that the tag is pointing to."""
return subprocess.getoutput("git rev-list -n 1 {tag}".format(tag=tag))


def get_head_sha():
"""Return the sha key of HEAD."""
return subprocess.getoutput("git rev-parse HEAD")


def is_head_at_tag(tag):
"""Return True or False depending on whether the given tag is pointing to HEAD"""
return get_head_sha() == get_tag_commit_sha(tag)


def get_version():
"""
Return the full git version using the given template. If there are no annotated tags, the version specified by
starting_version will be used. If HEAD is at the tag, the version will be the tag itself. If there are commits ahead
of the tag, the first 8 characters of the sha of the HEAD commit will be included.
In all of the above cases, if the working tree is also dirty or contains untracked files, a "+dirty" suffix will be
appended to the version.
Returns:
the formatted version based on tags in the git repository.
"""
template = "{tag}.dev{sha}"
tag = get_latest_tag()
if is_head_at_tag(tag):
version = tag
else:
sha = get_head_sha()[:8]
version = template.format(tag=tag, sha=sha)

return version


# add the readme as the description
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

# make the requirements.txt be installed (not good practice for general packaging, good for current oscar set up)
with open("requirements.txt") as f:
required = f.read().splitlines()

setuptools.setup(
name="titan", # Replace with your own username,
version=get_version(),
# author="Example Author",
# author_email="[email protected]",
description="TITAN Agent Based Model",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/marshall-lab/TITAN",
packages=setuptools.find_packages(),
install_requires=required,
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
package_data={"titan": ["params/*.yml", "settings/*/*.yml"]},
entry_points={"console_scripts": ["run_titan=titan:script_init"]},
)
189 changes: 0 additions & 189 deletions subTitan.sh

This file was deleted.

Loading

0 comments on commit 2e72ca9

Please sign in to comment.