From 4f04c7870130de9f3958a45b656349d6cff91019 Mon Sep 17 00:00:00 2001 From: Max Regan Date: Sat, 27 Nov 2021 21:31:48 -0500 Subject: [PATCH] Add CI/build infrastructure --- .gitignore | 14 ++++++++++++++ .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ setup.cfg | 36 ++++++++++++++++++++++++++++++++++++ setup.py | 4 ++++ 4 files changed, 85 insertions(+) create mode 100644 .gitignore create mode 100644 .gitlab-ci.yml create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6df443c --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +.DS_Store +.idea +*.log +tmp/ + +*.py[cod] +*.egg +build +htmlcov +src/gbasm.egg-info +**/.mypy_cache +**/.pytest_cache +**/.tox +**/__pycache__ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d7929df --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +image: python:latest + +# Change pip's cache directory to be inside the project directory since we can +# only cache local items. +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + +# Pip's cache doesn't store the python packages +# https://pip.pypa.io/en/stable/reference/pip_install/#caching +# +# If you want to also cache the installed packages, you have to install +# them in a virtualenv and cache it as well. +cache: + paths: + - .cache/pip + - venv/ + +before_script: + - python -V + - pip install virtualenv + - virtualenv venv + - source venv/bin/activate + +lint: + script: + - pip3 install black + - black --check src/ + +test: + script: + - pip3 install tox diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..09cd466 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,36 @@ +[metadata] +name = gbasm +version = 0.0.1 +author = Max Regan +author_email = mgregan2@gmail.com +description = An assembler for Gameboy assembly language +classifiers = + Programming Language :: Python :: 3 + License :: OSI Approved :: MIT License + Operating System :: OS Independent + +[options] +package_dir = + = src +packages = find: +python_requires = >=3.7 +tests_require = pytest +test_suite = test_assemble +requires = pyyaml, foobarbdfasf + +[options.packages.find] +where = + src + test + +[options.entry_points] +console_scripts = + gbasm = gbasm.gbasm:main + +[tox:tox] +envlist = py39 + +[testenv] +deps = pytest + pyyaml +commands = pytest diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a2fc30f --- /dev/null +++ b/setup.py @@ -0,0 +1,4 @@ +import os +from setuptools import setup + +setup()