Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assorted maintenance updates #517

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Add hashes of linting commits here
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
22 changes: 9 additions & 13 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.8, 3.11] # Check against oldest and newest versions
python-version: [3.9, 3.11] # Check against oldest and newest versions
jax: ["", "_jax"]
exclude: # Skip win + jax
- jax: "_jax"
Expand All @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Additional info about the build
shell: bash
Expand All @@ -45,12 +45,10 @@ jobs:
ulimit -a

- name: Setup Conda via Mamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test_env${{ matrix.jax }}.yaml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}

- name: Install package
Expand Down Expand Up @@ -86,7 +84,7 @@ jobs:
python umbrella-sampling-advanced-fes.py

- name: CodeCov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand All @@ -98,21 +96,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.9]
env:
PACKAGE: "pymbar"

steps:
- name: Checkout the code
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Setup Conda via Mamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}

- name: Install linter and formatter
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,5 @@ docs/pymbar-docs
docs/_build
tools/hash_dict.pickle
docs/examples/generated/

.DS_Store
37 changes: 19 additions & 18 deletions devtools/travis-ci/push-docs-to-s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,36 @@
import thermopyl.version


BUCKET_NAME = 'thermopyl.org'
BUCKET_NAME = "thermopyl.org"
if not thermopyl.version.release:
PREFIX = 'latest'
PREFIX = "latest"
else:
PREFIX = thermopyl.version.short_version

if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
raise ImportError('The s3cmd pacakge is required. try $ pip install s3cmd')
if not any(d.project_name == "s3cmd" for d in pip.get_installed_distributions()):
raise ImportError("The s3cmd pacakge is required. try $ pip install s3cmd")
# The secret key is available as a secure environment variable
# on travis-ci to push the build documentation to Amazon S3.
with tempfile.NamedTemporaryFile('w') as f:
f.write('''[default]
with tempfile.NamedTemporaryFile("w") as f:
f.write(
"""[default]
access_key = {AWS_ACCESS_KEY_ID}
secret_key = {AWS_SECRET_ACCESS_KEY}
'''.format(**os.environ))
""".format(
**os.environ
)
)
f.flush()

template = ('s3cmd --guess-mime-type --config {config} '
'sync docs/_build/ s3://{bucket}/{prefix}/')
cmd = template.format(
config=f.name,
bucket=BUCKET_NAME,
prefix=PREFIX)
template = (
"s3cmd --guess-mime-type --config {config} " "sync docs/_build/ s3://{bucket}/{prefix}/"
)
cmd = template.format(config=f.name, bucket=BUCKET_NAME, prefix=PREFIX)
return_val = subprocess.call(cmd.split())

# Sync index file.
template = ('s3cmd --guess-mime-type --config {config} '
'sync devtools/ci/index.html s3://{bucket}/')
cmd = template.format(
config=f.name,
bucket=BUCKET_NAME)
template = (
"s3cmd --guess-mime-type --config {config} " "sync devtools/ci/index.html s3://{bucket}/"
)
cmd = template.format(config=f.name, bucket=BUCKET_NAME)
return_val = subprocess.call(cmd.split())
23 changes: 18 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -262,7 +262,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
("index", "pymbar.tex", "pymbar Documentation", pymbar.__maintainer__, "manual",),
(
"index",
"pymbar.tex",
"pymbar Documentation",
pymbar.__maintainer__,
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand All @@ -285,13 +291,21 @@
# If false, no module index is generated.
# latex_domain_indices = True

bibtex_bibfiles = ['references.bib']
bibtex_bibfiles = ["references.bib"]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "pymbar", "pymbar Documentation", [pymbar.__maintainer__], 1,)]
man_pages = [
(
"index",
"pymbar",
"pymbar Documentation",
[pymbar.__maintainer__],
1,
)
]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand Down Expand Up @@ -325,4 +339,3 @@

# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False

15 changes: 13 additions & 2 deletions pymbar/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,15 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
# if there isn't one, this yields HEX[-dirty] (no NUM)
describe_out, rc = run_command(
GITS,
["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix,],
[
"describe",
"--tags",
"--dirty",
"--always",
"--long",
"--match",
"%s*" % tag_prefix,
],
cwd=root,
)
# --long was added in git-1.5.5
Expand Down Expand Up @@ -294,7 +302,10 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
if verbose:
fmt = "tag '%s' doesn't start with prefix '%s'"
print(fmt % (full_tag, tag_prefix))
pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix,)
pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (
full_tag,
tag_prefix,
)
return pieces
pieces["closest-tag"] = full_tag[len(tag_prefix) :]

Expand Down
13 changes: 6 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
python_requires=">=3.6",
install_requires=["numpy>=1.12",
"scipy",
"numexpr",
],
install_requires=[
"numpy>=1.12",
"scipy",
"numexpr",
],
extras_require={
"jax": ["jaxlib;platform_system!='Windows'",
"jax;platform_system!='Windows'"
],
"jax": ["jaxlib;platform_system!='Windows'", "jax;platform_system!='Windows'"],
},
)
Loading