Skip to content

Commit

Permalink
Merge pull request #199 from JessicaTegner/ci
Browse files Browse the repository at this point in the history
Improvement to workflow, test fixes and new basis
  • Loading branch information
timofurrer authored Oct 17, 2022
2 parents f3f95a9 + cd4b4e7 commit 46ab6ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
name: Continuous Integration and Deployment

on: [push]
on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [2.7, 3.5, 3.6, 3.7]
os: [ubuntu-latest, macOS-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Setup build and test environment
Expand Down Expand Up @@ -46,9 +45,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v4.2.0
with:
python-version: 3.7
- name: Setup docs environment
Expand All @@ -62,20 +61,18 @@ jobs:
needs: [build, docs]
runs-on: ubuntu-latest

if: startsWith(github.event.ref, 'refs/tags') && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python 3.7
if: startsWith(github.event.ref, 'refs/tags')
uses: actions/setup-python@v1
uses: actions/[email protected]
with:
python-version: 3.7
- name: Build Package
if: startsWith(github.event.ref, 'refs/tags')
run: |
python -m pip install --upgrade pip setuptools wheel
python setup.py sdist bdist_wheel --universal
- name: Publish Package on PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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 = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
8 changes: 4 additions & 4 deletions src/maya/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ def long_count(self):
"""Returns a Mayan Long Count representation of the Maya DT."""
# Creation (0.0.0.0.0) occurred on -3114-08-11
# 1856305 is distance (in days) between Creation and UNIX epoch
days_since_creation = int(1856305 + self._epoch / (3600*24))
days_since_creation = int(1856305 + self._epoch / (3600 * 24))
caps = (0, 20, 20, 18, 20)
lc_date = [0, 0, 0, 0, days_since_creation]
for i in range(4, 0, -1):
if lc_date[i] >= caps[i]:
lc_date[i-1] += int(lc_date[i]/caps[i])
lc_date[i - 1] += int(lc_date[i] / caps[i])
lc_date[i] %= caps[i]
elif lc_date[i] < 0:
lc_date[i-1] += int(lc_date[i]/caps[i])
lc_date[i - 1] += int(lc_date[i] / caps[i])
lc_date[i] = 0
return '.'.join(str(i) for i in lc_date)

Expand Down Expand Up @@ -372,7 +372,7 @@ def slang_date(self, locale="en"):
except KeyError:
pass

delta = humanize.time.abs_timedelta(
delta = humanize.time._abs_timedelta(
timedelta(seconds=(self.epoch - now().epoch))
)

Expand Down

0 comments on commit 46ab6ac

Please sign in to comment.