Skip to content

Commit

Permalink
Initial python project files
Browse files Browse the repository at this point in the history
Bare bones files for packaging and testing the new library.
  • Loading branch information
eggmaster authored and jguiditta committed Feb 2, 2023
1 parent fdbd5e0 commit c1dbc29
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: run tests
on:
push:
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run Tox
# Run tox using the version of Python in `PATH`
run: tox -epy
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Lint with flake8
run: tox -eflake8
twine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run twine-check
run: tox -etwine
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ipython_config.py
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
Expand Down
10 changes: 10 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
bugjira = {path = ".",editable = true}

[dev-packages]
bugjira = {path = ".",extras = ["devbase","test","docs","dist"],editable = true}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Bugjira
Bugjira is an abstraction layer library for interacting with either bugzilla or JIRA through the use of their respective python libraries.
2 changes: 2 additions & 0 deletions dist-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-i https://pypi.python.org/simple
-e .[devbase,dist]
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]
requires = [
"setuptools>=61.0",
"wheel",
"setuptools_scm[toml]>=6.2"
]
build-backend = "setuptools.build_meta"
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-i https://pypi.python.org/simple
-e .
52 changes: 52 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[metadata]
name = bugjira
author = Steve Linabery
author_email = [email protected]
description = API abstraction library for bugzilla and jira APIs
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/release-depot/bugjira
project_urls =
Bug Tracker = https://github.com/release-depot/bugjira/issues
license = MIT
license_files = LICENSE
classifiers =
Development Status :: 3 - Alpha
Environment :: Web Environment
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Operating System :: OS Independent

[options]
package_dir =
= src
packages = find:
python_requires = >=3.7
install_requires =

[options.extras_require]
devbase =
tox

test =
flake8
pytest
pytest-cov

docs =
sphinx==4.3.1
sphinx-autobuild==2021.3.14
sphinx-rtd-theme==0.5.2
myst-parser==0.15.2

dist =
build
setuptools_scm
twine

[options.packages.find]
where = src

[flake8]
exclude = docs
20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""The setup script."""

import os

from setuptools import setup


def check_if_scm():
if os.environ.get('SCM_NO_LOCAL_SCHEME'):
return "no-local-version"
else:
return "node-and-date"


setup(
use_scm_version={'local_scheme': check_if_scm()}
)
Empty file added src/bugjira/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-i https://pypi.python.org/simple
-e .[devbase,test]
3 changes: 3 additions & 0 deletions tests/test_stub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def test_pytest():
# no-op test to show that pytest can run in the tox environment
pass
11 changes: 11 additions & 0 deletions tooling/build_changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# FIXME: Delete this line and uncomment the following lines after the first tag is pushed
#the_dir=$1
#: ${the_dir:=.}
#cd $the_dir
#pwd
## We run the script twice. First time it to create the base file:
#curl -s "https://raw.githubusercontent.com/release-depot/change/latest/change" |
#sh -s -- init
## Second time is to populate it with tag data:
#curl -s "https://raw.githubusercontent.com/release-depot/change/latest/change" |
#sh -s --
35 changes: 35 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tox]
envlist =
py{37,38,39,310,311}
flake8

[testenv]
passenv=HOME
sitepackages = False
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/dist-requirements.txt
commands =
pytest --cov-report=term-missing --cov=src tests

[testenv:flake8]
passenv=HOME
sitepackages = False
commands =
flake8 --ignore=E501,W504 setup.py src tests

[testenv:build]
passenv =
SCM_NO_LOCAL_SCHEME
allowlist_externals =
/bin/bash
commands =
/bin/bash tooling/build_changelog
python -m build

[testenv:twine]
allowlist_externals = /bin/bash
commands =
/bin/bash tooling/build_changelog
python -m build
twine check --strict dist/*

0 comments on commit c1dbc29

Please sign in to comment.