Skip to content

Commit 8bc22a5

Browse files
committed
Initial commit
0 parents  commit 8bc22a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+6887
-0
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore all Git auto CR/LF line endings conversions
2+
* -text
3+
pyproject.toml export-subst

.github/workflows/docs-ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI Documentation
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-20.04
8+
9+
strategy:
10+
max-parallel: 4
11+
matrix:
12+
python-version: [3.9]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Give permission to run scripts
24+
run: chmod +x ./docs/scripts/doc8_style_check.sh
25+
26+
- name: Install Dependencies
27+
run: pip install -e .[docs]
28+
29+
- name: Check Sphinx Documentation build minimally
30+
working-directory: ./docs
31+
run: sphinx-build -E -W source build
32+
33+
- name: Check for documentation style errors
34+
working-directory: ./docs
35+
run: ./scripts/doc8_style_check.sh
36+
37+

.github/workflows/pypi-release.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch
2+
3+
4+
# This is executed automatically on a tag in the main branch
5+
6+
# Summary of the steps:
7+
# - build wheels and sdist
8+
# - upload wheels and sdist to PyPI
9+
# - create gh-release and upload wheels and dists there
10+
# TODO: smoke test wheels and sdist
11+
# TODO: add changelog to release text body
12+
13+
# WARNING: this is designed only for packages building as pure Python wheels
14+
15+
on:
16+
workflow_dispatch:
17+
push:
18+
tags:
19+
- "v*.*.*"
20+
21+
jobs:
22+
build-pypi-distribs:
23+
name: Build and publish library to PyPI
24+
runs-on: ubuntu-20.04
25+
26+
steps:
27+
- uses: actions/checkout@master
28+
- name: Set up Python
29+
uses: actions/setup-python@v1
30+
with:
31+
python-version: 3.9
32+
33+
- name: Install pypa/build
34+
run: python -m pip install build --user
35+
36+
- name: Build a binary wheel and a source tarball
37+
run: python -m build --sdist --wheel --outdir dist/
38+
39+
- name: Upload built archives
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: pypi_archives
43+
path: dist/*
44+
45+
46+
create-gh-release:
47+
name: Create GH release
48+
needs:
49+
- build-pypi-distribs
50+
runs-on: ubuntu-20.04
51+
52+
steps:
53+
- name: Download built archives
54+
uses: actions/download-artifact@v3
55+
with:
56+
name: pypi_archives
57+
path: dist
58+
59+
- name: Create GH release
60+
uses: softprops/action-gh-release@v1
61+
with:
62+
draft: true
63+
files: dist/*
64+
65+
66+
create-pypi-release:
67+
name: Create PyPI release
68+
needs:
69+
- create-gh-release
70+
runs-on: ubuntu-20.04
71+
72+
steps:
73+
- name: Download built archives
74+
uses: actions/download-artifact@v3
75+
with:
76+
name: pypi_archives
77+
path: dist
78+
79+
- name: Publish to PyPI
80+
if: startsWith(github.ref, 'refs/tags')
81+
uses: pypa/gh-action-pypi-publish@master
82+
with:
83+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Python compiled files
2+
*.py[cod]
3+
4+
# virtualenv and other misc bits
5+
*.egg-info
6+
/dist
7+
/build
8+
/bin
9+
/lib
10+
/scripts
11+
/Scripts
12+
/Lib
13+
/pip-selfcheck.json
14+
/tmp
15+
/venv
16+
.Python
17+
/include
18+
/Include
19+
/local
20+
*/local/*
21+
/local/
22+
/share/
23+
/tcl/
24+
/.eggs/
25+
26+
# Installer logs
27+
pip-log.txt
28+
29+
# Unit test / coverage reports
30+
.cache
31+
.coverage
32+
.coverage.*
33+
nosetests.xml
34+
htmlcov
35+
36+
# Translations
37+
*.mo
38+
39+
# IDEs
40+
.project
41+
.pydevproject
42+
.idea
43+
org.eclipse.core.resources.prefs
44+
.vscode
45+
.vs
46+
47+
# Sphinx
48+
docs/_build
49+
docs/bin
50+
docs/build
51+
docs/include
52+
docs/Lib
53+
doc/pyvenv.cfg
54+
pyvenv.cfg
55+
56+
# Various junk and temp files
57+
.DS_Store
58+
*~
59+
.*.sw[po]
60+
.build
61+
.ve
62+
*.bak
63+
/.cache/
64+
65+
# pyenv
66+
/.python-version
67+
/man/
68+
/.pytest_cache/
69+
lib64
70+
tcl
71+
72+
# Ignore Jupyter Notebook related temp files
73+
.ipynb_checkpoints/

.readthedocs.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Where the Sphinx conf.py file is located
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
12+
# Setting the python version and doc build requirements
13+
python:
14+
install:
15+
- method: pip
16+
path: .
17+
extra_requirements:
18+
- docs

.travis.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This is a skeleton Travis CI config file that provides a starting point for adding CI
2+
# to a Python project. Since we primarily develop in python3, this skeleton config file
3+
# will be specific to that language.
4+
#
5+
# See https://config.travis-ci.com/ for a full list of configuration options.
6+
7+
os: linux
8+
9+
dist: xenial
10+
11+
language: python
12+
python:
13+
- "3.6"
14+
- "3.7"
15+
- "3.8"
16+
- "3.9"
17+
18+
# Scripts to run at install stage
19+
install: ./configure --dev
20+
21+
# Scripts to run at script stage
22+
script: venv/bin/pytest

AUTHORS.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The following organizations or individuals have contributed to this repo:
2+
3+
-

CHANGELOG.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Changelog
2+
=========
3+
4+
5+
v0.0.0
6+
------
7+
8+
*xxxx-xx-xx* -- Initial release.

MANIFEST.in

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
graft src
2+
3+
include *.LICENSE
4+
include NOTICE
5+
include *.ABOUT
6+
include *.toml
7+
include *.yml
8+
include *.rst
9+
include setup.*
10+
include configure*
11+
include requirements*
12+
include .git*
13+
14+
global-exclude *.py[co] __pycache__ *.*~
15+

NOTICE

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright (c) nexB Inc. and others.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
6+
# ScanCode is a trademark of nexB Inc.
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
#

README.rst

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
A Simple Python Project Skeleton
2+
================================
3+
This repo attempts to standardize the structure of the Python-based project's
4+
repositories using modern Python packaging and configuration techniques.
5+
Using this `blog post`_ as inspiration, this repository serves as the base for
6+
all new Python projects and is mergeable in existing repositories as well.
7+
8+
.. _blog post: https://blog.jaraco.com/a-project-skeleton-for-python-projects/
9+
10+
11+
Usage
12+
=====
13+
14+
A brand new project
15+
-------------------
16+
.. code-block:: bash
17+
18+
git init my-new-repo
19+
cd my-new-repo
20+
git pull [email protected]:nexB/skeleton
21+
22+
# Create the new repo on GitHub, then update your remote
23+
git remote set-url origin [email protected]:nexB/your-new-repo.git
24+
25+
From here, you can make the appropriate changes to the files for your specific project.
26+
27+
Update an existing project
28+
---------------------------
29+
.. code-block:: bash
30+
31+
cd my-existing-project
32+
git remote add skeleton [email protected]:nexB/skeleton
33+
git fetch skeleton
34+
git merge skeleton/main --allow-unrelated-histories
35+
36+
This is also the workflow to use when updating the skeleton files in any given repository.
37+
38+
More usage instructions can be found in ``docs/skeleton-usage.rst``.
39+
40+
41+
Release Notes
42+
=============
43+
44+
- 2022-03-04:
45+
- Synchronize configure and configure.bat scripts for sanity
46+
- Update CI operating system support with latest Azure OS images
47+
- Streamline utility scripts in etc/scripts/ to create, fetch and manage third-party dependencies
48+
There are now fewer scripts. See etc/scripts/README.rst for details
49+
50+
- 2021-09-03:
51+
- ``configure`` now requires pinned dependencies via the use of ``requirements.txt`` and ``requirements-dev.txt``
52+
- ``configure`` can now accept multiple options at once
53+
- Add utility scripts from scancode-toolkit/etc/release/ for use in generating project files
54+
- Rename virtual environment directory from ``tmp`` to ``venv``
55+
- Update README.rst with instructions for generating ``requirements.txt`` and ``requirements-dev.txt``,
56+
as well as collecting dependencies as wheels and generating ABOUT files for them.
57+
58+
- 2021-05-11:
59+
- Adopt new configure scripts from ScanCode TK that allows correct configuration of which Python version is used.

0 commit comments

Comments
 (0)