Skip to content
Merged
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
8 changes: 5 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run:
python -m pip install pytest numpy
- name: Install package and test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install .
- name: Test with pytest
run:
pytest -v
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

35 changes: 1 addition & 34 deletions grader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
# -*- coding: utf-8 -*-
"""
grader: a Python module and command-line utility to grade applications.
"""
import os

# current dir
CWD = os.path.abspath(os.path.dirname(__file__))
__version__ = '0.1'

__name__ = 'grader'
__description__ = 'a Python module and command-line utility to grade applications'
__version__ = '0.1'
__url__ = 'https://github.com/ASPP/grader'
__author__ = 'grader contributor'
__license__ = 'GPLv3+'


def revision():
# get the git SHA if we are in a git repo (only useful for devs)
import subprocess

# try two options for getting the git revision
# - nice version with tags
# - plain SHA
for cmd in ('git describe --tags --dirty=+'), ('git rev-parse HEAD'):
try:
proc = subprocess.check_output(cmd.split(), cwd=CWD,
stderr=subprocess.PIPE, universal_newlines=True)
revision = proc.strip()
except Exception:
# ok, don't bother
revision = ''
return revision


# have a way to test from python
def test():
import pytest
pytest.main([CWD,])
14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "grader/__init__.py"

[project]
name = "grader"
description = "a Python module and command-line utility to grade applications"
version = "0.1"
authors = [{name = "Grader contributors"}]
keywords = ["grading applications"]
license = "GPL-3.0-or-later"
Expand All @@ -13,6 +19,7 @@ classifiers = [ 'Development Status :: 3 - Alpha',
urls = {Homepage = "https://github.com/ASPP/grader"}
requires-python = ">= 3.10"
dependencies = ['numpy',]
dynamic = ["version",]

[project.readme]
file = "README.md"
Expand All @@ -23,3 +30,8 @@ grader = "grader.grader:main"

[tool.aliases]
test = "pytest"

[dependency-groups]
dev = [
"pytest",
]