Buncha fix ups

renamed:    .hgignore -> .gitignore
	new file:   .gitlab-ci.yml
	new file:   Makefile
	modified:   README.rst
	new file:   ago/__init__.py
	renamed:    ago.py -> ago/ago.py
	new file:   ago/tests/__init__.py
	renamed:    test_ago.py -> ago/tests/test_ago.py
	new file:   requirements-test.txt
	modified:   setup.py
This commit is contained in:
Russell Ballestrini 2022-07-06 13:56:35 -04:00
parent e09188f666
commit 16d2dc15f6
10 changed files with 43 additions and 12 deletions

View file

@ -1,6 +1,3 @@
# use glob syntax.
syntax: glob
*.pyc
*.swp
*.orig
@ -8,3 +5,4 @@ syntax: glob
*.gz
build/*
.cache/*
env/*

14
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,14 @@
stages:
- test
#- build
#- deploy
test:
stage: test
tags: ["build"]
script: make test
artifacts:
paths:
- env.vanilla
expire_in: 1 hour

10
Makefile Normal file
View file

@ -0,0 +1,10 @@
env:
python3 -m venv env
. env/bin/activate
env/bin/pip install --upgrade pip
test: env
#env/bin/py.test --lf
env/bin/pip install --upgrade -r requirements-test.txt
env/bin/py.test

View file

@ -122,4 +122,4 @@ License
Public Revision Control
==============================
* https://git.unturf.com/python/miniuri
* https://git.unturf.com/python/ago

1
ago/__init__.py Normal file
View file

@ -0,0 +1 @@
from ago import *

View file

@ -32,9 +32,9 @@ def delta2dict(delta):
"day": int(delta.days % 365),
"hour": int(delta.seconds / 3600),
"minute": int(delta.seconds / 60) % 60,
"second": delta.seconds % 60,
"millisecond": delta.microseconds / 1000,
"microsecond": delta.microseconds % 1000,
"second": int(delta.seconds % 60),
"millisecond": int(delta.microseconds / 1000),
"microsecond": int(delta.microseconds % 1000),
}

0
ago/tests/__init__.py Normal file
View file

View file

@ -2,8 +2,8 @@ from __future__ import print_function
from datetime import datetime, timedelta, tzinfo
from ago import human
from ago import delta2dict
from ..ago import human
from ..ago import delta2dict
# datetime objects
PRESENT = datetime.now()

5
requirements-test.txt Normal file
View file

@ -0,0 +1,5 @@
# testing.
pytest
pytest-cov
nose
twine

View file

@ -1,6 +1,6 @@
# installation: pip install ago
from setuptools import setup
from setuptools import setup, find_packages
setup(
name="ago",
@ -10,7 +10,8 @@ setup(
long_description=open("README.rst").read(),
author="Russell Ballestrini",
author_email="russell.ballestrini@gmail.com",
url="https://git.unturf.com/python/miniuri"
url="https://git.unturf.com/python/ago",
packages=find_packages(exclude="tests"),
platforms=["All"],
license="Public Domain",
py_modules=["ago"],
@ -20,4 +21,6 @@ setup(
# setup keyword args: http://peak.telecommunity.com/DevCenter/setuptools
# built and uploaded to pypi with this:
# python setup.py sdist bdist_egg register upload
#python setup.py sdist bdist_egg
#twine upload dist/*