Skip to content

Commit 790e8d9

Browse files
committed
Merge branch update-boilerplate from skeleton
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2 parents bd32341 + d3e2d28 commit 790e8d9

24 files changed

+552
-34
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@ pyvenv.cfg
6767
/.pytest_cache/
6868
lib64
6969
tcl
70+
71+
# Ignore Jupyter Notebook related temp files
72+
.ipynb_checkpoints/

.readthedocs.yml

Lines changed: 18 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This is a skeleton Travis CI config file that provides a starting point for adding CI
22
# to a Python project. Since we primarily develop in python3, this skeleton config file
3-
# will be specific to that language.
3+
# will be specific to that language.
44
#
55
# See https://config.travis-ci.com/ for a full list of configuration options.
66

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ include *.LICENSE
44
include NOTICE
55
include *.ABOUT
66
include *.toml
7+
include *.yml
78
include *.rst
89
include setup.*
910
include configure*
1011
include requirements*
12+
include .git*
1113

1214
global-exclude *.py[co] __pycache__ *.*~
1315

NOTICE

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
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-
#
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__ *.*~

README.rst

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1-
extractcode
1+
ExtractCode
22
===========
3-
A set of functions and utilities used to extract archives.
3+
4+
CommonCode
5+
==========
6+
7+
- license: Apache-2.0
8+
- copyright: copyright (c) nexB. Inc. and others
9+
- homepage_url: https://github.com/nexB/extractode
10+
- keywords: archiev, extraction, libarchive, 7zip, scancode-toolkit
11+
12+
A set of functions and utilities used to extract archives in a mostly universal way.
13+
This libraries uses multiple techniques to extract archives reliably including
14+
using the Python standard library, and bundled 7zip and libarchive to use the
15+
best tool to extract evebtually any archive and compressed file.
16+
17+
18+
Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
19+
20+
To set up the development environment::
21+
22+
source configure
23+
24+
To run unit tests::
25+
26+
pytest -vvs -n 2
27+
28+
To clean up development environment::
29+
30+
./configure --clean
31+
32+

azure-pipelines.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
################################################################################
3+
# We use Azure to run the full tests suites on multiple Python 3.x
4+
# on multiple Windows, macOS and Linux versions all on 64 bits
5+
# These jobs are using VMs with Azure-provided Python builds
6+
################################################################################
7+
8+
jobs:
9+
10+
- template: etc/ci/azure-linux.yml
11+
parameters:
12+
job_name: ubuntu16_cpython
13+
image_name: ubuntu-16.04
14+
python_versions: ['3.6', '3.7', '3.8', '3.9']
15+
test_suites:
16+
all: tmp/bin/pytest -vvs
17+
18+
- template: etc/ci/azure-linux.yml
19+
parameters:
20+
job_name: ubuntu18_cpython
21+
image_name: ubuntu-18.04
22+
python_versions: ['3.6', '3.7', '3.8', '3.9']
23+
test_suites:
24+
all: tmp/bin/pytest -n 2 -vvs
25+
26+
- template: etc/ci/azure-linux.yml
27+
parameters:
28+
job_name: ubuntu20_cpython
29+
image_name: ubuntu-20.04
30+
python_versions: ['3.6', '3.7', '3.8', '3.9']
31+
test_suites:
32+
all: tmp/bin/pytest -n 2 -vvs
33+
34+
- template: etc/ci/azure-mac.yml
35+
parameters:
36+
job_name: macos1014_cpython
37+
image_name: macos-10.14
38+
python_versions: ['3.6', '3.7', '3.8', '3.9']
39+
test_suites:
40+
all: tmp/bin/pytest -n 2 -vvs
41+
42+
- template: etc/ci/azure-mac.yml
43+
parameters:
44+
job_name: macos1015_cpython
45+
image_name: macos-10.15
46+
python_versions: ['3.6', '3.7', '3.8', '3.9']
47+
test_suites:
48+
all: tmp/bin/pytest -n 2 -vvs
49+
50+
- template: etc/ci/azure-win.yml
51+
parameters:
52+
job_name: win2016_cpython
53+
image_name: vs2017-win2016
54+
python_versions: ['3.6', '3.7', '3.8', '3.9']
55+
test_suites:
56+
all: tmp\Scripts\pytest -n 2 -vvs
57+
58+
- template: etc/ci/azure-win.yml
59+
parameters:
60+
job_name: win2019_cpython
61+
image_name: windows-2019
62+
python_versions: ['3.6', '3.7', '3.8', '3.9']
63+
test_suites:
64+
all: tmp\Scripts\pytest -n 2 -vvs

configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.
3+
# Copyright (c) nexB Inc. and others.
4+
# SPDX-License-Identifier: Apache-2.0
45
#
56

67
set -e

configure.bat

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
@echo OFF
2+
@setlocal
3+
@rem Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.
4+
5+
@rem ################################
6+
@rem # A configuration script for Windows
7+
@rem #
8+
@rem # The options and (optional) arguments are:
9+
@rem # --clean : this is exclusive of anything else and cleans the environment
10+
@rem # from built and installed files
11+
@rem #
12+
@rem # --python < path to python.exe> : this must be the first argument and set
13+
@rem # the path to the Python executable to use. If < path to python.exe> is
14+
@rem # set to "path", then the executable will be the python.exe available
15+
@rem # in the PATH.
16+
@rem ################################
17+
18+
@rem Current directory where this .bat files lives
19+
set CFG_ROOT_DIR=%~dp0
20+
@rem path where a configured Python should live in the current virtualenv if installed
21+
set CONFIGURED_PYTHON=%CFG_ROOT_DIR%tmp\Scripts\python.exe
22+
set PYTHON_EXECUTABLE=
23+
24+
25+
@rem parse command line options and arguments
26+
:collectopts
27+
if "%1" EQU "--help" (goto cli_help)
28+
if "%1" EQU "--clean" (call rmdir /s /q "%CFG_ROOT_DIR%tmp") && call exit /b
29+
if "%1" EQU "--python" (set PROVIDED_PYTHON=%~2) && shift && shift && goto collectopts
30+
31+
@rem If we have a pre-configured Python in our virtualenv, reuse this as-is and run
32+
if exist ""%CONFIGURED_PYTHON%"" (
33+
set PYTHON_EXECUTABLE=%CONFIGURED_PYTHON%
34+
goto run
35+
)
36+
37+
@rem If we have a command arg for Python use this as-is
38+
if ""%PROVIDED_PYTHON%""==""path"" (
39+
@rem use a bare python available in the PATH
40+
set PYTHON_EXECUTABLE=python
41+
goto run
42+
)
43+
if exist ""%PROVIDED_PYTHON%"" (
44+
set PYTHON_EXECUTABLE=%PROVIDED_PYTHON%
45+
goto run
46+
)
47+
48+
49+
@rem otherwise we search for a suitable Python interpreter
50+
:find_python
51+
@rem First check the existence of the "py" launcher (available in Python 3)
52+
@rem if we have it, check if we have a py -3 installed with the good version or a py 2.7
53+
@rem if not, check if we have an old py 2.7
54+
@rem exist if all fails
55+
56+
where py >nul 2>nul
57+
if %ERRORLEVEL% == 0 (
58+
@rem we have a py launcher, check for the availability of our required Python 3 version
59+
py -3.6 --version >nul 2>nul
60+
if %ERRORLEVEL% == 0 (
61+
set PYTHON_EXECUTABLE=py -3.6
62+
) else (
63+
@rem we have no required python 3, let's try python 2:
64+
py -2 --version >nul 2>nul
65+
if %ERRORLEVEL% == 0 (
66+
set PYTHON_EXECUTABLE=py -2
67+
) else (
68+
@rem we have py and no python 3 and 2, exit
69+
echo * Unable to find an installation of Python.
70+
exit /b 1
71+
)
72+
)
73+
) else (
74+
@rem we have no py launcher, check for a default Python 2 installation
75+
if not exist ""%DEFAULT_PYTHON2%"" (
76+
echo * Unable to find an installation of Python.
77+
exit /b 1
78+
) else (
79+
set PYTHON_EXECUTABLE=%DEFAULT_PYTHON2%
80+
)
81+
)
82+
83+
84+
:run
85+
@rem without this things may not always work on Windows 10, but this makes things slower
86+
set PYTHONDONTWRITEBYTECODE=1
87+
88+
call mkdir "%CFG_ROOT_DIR%tmp"
89+
call curl -o "%CFG_ROOT_DIR%tmp\virtualenv.pyz" https://bootstrap.pypa.io/virtualenv.pyz
90+
call %PYTHON_EXECUTABLE% "%CFG_ROOT_DIR%tmp\virtualenv.pyz" "%CFG_ROOT_DIR%tmp"
91+
call "%CFG_ROOT_DIR%tmp\Scripts\activate"
92+
call "%CFG_ROOT_DIR%tmp\Scripts\pip" install --upgrade pip virtualenv setuptools wheel
93+
call "%CFG_ROOT_DIR%tmp\Scripts\pip" install -e .[testing]
94+
95+
@rem Return a proper return code on failure
96+
if %ERRORLEVEL% neq 0 (
97+
exit /b %ERRORLEVEL%
98+
)
99+
endlocal
100+
goto activate
101+
102+
103+
:cli_help
104+
echo A configuration script for Windows
105+
echo usage: configure [options] [path/to/config/directory]
106+
echo.
107+
echo The options and arguments are:
108+
echo --clean : this is exclusive of anything else and cleans the environment
109+
echo from built and installed files
110+
echo.
111+
echo --python path/to/python.exe : this is set to the path of an alternative
112+
echo Python executable to use. If path/to/python.exe is set to "path",
113+
echo then the executable will be the python.exe available in the PATH.
114+
echo.
115+
116+
117+
:activate
118+
@rem Activate the virtualenv
119+
if exist "%CFG_ROOT_DIR%tmp\Scripts\activate" (
120+
"%CFG_ROOT_DIR%tmp\Scripts\activate"
121+
)

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 commit comments

Comments
 (0)