Skip to content

Commit 0fca296

Browse files
committed
Merge latest skeleton
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2 parents 4c8b749 + b1dabd8 commit 0fca296

Some content is hidden

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

42 files changed

+6387
-178
lines changed

.gitignore

Lines changed: 56 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,73 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
1+
# Python compiled files
32
*.py[cod]
4-
*$py.class
53

6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
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
1016
.Python
11-
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
pip-wheel-metadata/
24-
share/python-wheels/
25-
*.egg-info/
26-
.installed.cfg
27-
*.egg
28-
MANIFEST
29-
30-
# PyInstaller
31-
# Usually these files are written by a python script from a template
32-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33-
*.manifest
34-
*.spec
17+
/include
18+
/Include
19+
/local
20+
*/local/*
21+
/local/
22+
/share/
23+
/tcl/
24+
/.eggs/
3525

3626
# Installer logs
3727
pip-log.txt
38-
pip-delete-this-directory.txt
3928

4029
# Unit test / coverage reports
41-
htmlcov/
42-
.tox/
43-
.nox/
30+
.cache
4431
.coverage
4532
.coverage.*
46-
.cache
4733
nosetests.xml
48-
coverage.xml
49-
*.cover
50-
*.py,cover
51-
.hypothesis/
52-
.pytest_cache/
53-
cover/
34+
htmlcov
5435

5536
# Translations
5637
*.mo
57-
*.pot
58-
59-
# Django stuff:
60-
*.log
61-
local_settings.py
62-
db.sqlite3
63-
db.sqlite3-journal
64-
65-
# Flask stuff:
66-
instance/
67-
.webassets-cache
6838

69-
# Scrapy stuff:
70-
.scrapy
71-
72-
# Sphinx documentation
73-
docs/_build/
74-
75-
# PyBuilder
76-
target/
77-
78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
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/
8464

8565
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98-
__pypackages__/
99-
100-
# Celery stuff
101-
celerybeat-schedule
102-
celerybeat.pid
103-
104-
# SageMath parsed files
105-
*.sage.py
106-
107-
# Environments
108-
.env
109-
.venv
110-
env/
111-
venv/
112-
ENV/
113-
env.bak/
114-
venv.bak/
115-
tmp
116-
117-
# Spyder project settings
118-
.spyderproject
119-
.spyproject
120-
121-
# Rope project settings
122-
.ropeproject
123-
124-
# mkdocs documentation
125-
/site
126-
127-
# mypy
128-
.mypy_cache/
129-
.dmypy.json
130-
dmypy.json
131-
132-
# Pyre type checker
133-
.pyre/
134-
135-
# pytype static type analyzer
136-
.pytype/
66+
/.python-version
67+
/man/
68+
/.pytest_cache/
69+
lib64
70+
tcl
71+
72+
# Ignore Jupyter Notebook related temp files
73+
.ipynb_checkpoints/

README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Fetch some package metadata and get a ``fetchcode.packagedcode_models.Package``
6060
[Package(type='rubygems', namespace=None, name='files', version=None)]
6161

6262

63-
6463
License
6564
--------
6665

azure-pipelines.yml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,50 @@
77

88
jobs:
99

10-
- template: etc/ci/azure-posix.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-
1810
- template: etc/ci/azure-posix.yml
1911
parameters:
2012
job_name: ubuntu18_cpython
2113
image_name: ubuntu-18.04
22-
python_versions: ['3.6', '3.7', '3.8', '3.9']
14+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
2315
test_suites:
24-
all: tmp/bin/pytest -n 2 -vvs
16+
all: venv/bin/pytest -n 2 -vvs
2517

2618
- template: etc/ci/azure-posix.yml
2719
parameters:
2820
job_name: ubuntu20_cpython
2921
image_name: ubuntu-20.04
30-
python_versions: ['3.6', '3.7', '3.8', '3.9']
22+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
3123
test_suites:
32-
all: tmp/bin/pytest -n 2 -vvs
24+
all: venv/bin/pytest -n 2 -vvs
3325

3426
- template: etc/ci/azure-posix.yml
3527
parameters:
3628
job_name: macos1014_cpython
3729
image_name: macos-10.14
3830
python_versions: ['3.6', '3.7', '3.8', '3.9']
3931
test_suites:
40-
all: tmp/bin/pytest -n 2 -vvs
32+
all: venv/bin/pytest -n 2 -vvs
4133

4234
- template: etc/ci/azure-posix.yml
4335
parameters:
4436
job_name: macos1015_cpython
4537
image_name: macos-10.15
46-
python_versions: ['3.6', '3.7', '3.8', '3.9']
38+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
4739
test_suites:
48-
all: tmp/bin/pytest -n 2 -vvs
40+
all: venv/bin/pytest -n 2 -vvs
4941

5042
- template: etc/ci/azure-win.yml
5143
parameters:
5244
job_name: win2016_cpython
5345
image_name: vs2017-win2016
54-
python_versions: ['3.6', '3.7', '3.8', '3.9']
46+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
5547
test_suites:
56-
all: tmp\Scripts\pytest -n 2 -vvs
48+
all: venv\Scripts\pytest -n 2 -vvs
5749

5850
- template: etc/ci/azure-win.yml
5951
parameters:
6052
job_name: win2019_cpython
6153
image_name: windows-2019
62-
python_versions: ['3.6', '3.7', '3.8', '3.9']
54+
python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10']
6355
test_suites:
64-
all: tmp\Scripts\pytest -n 2 -vvs
56+
all: venv\Scripts\pytest -n 2 -vvs

configure

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ CLI_ARGS=$1
2626
################################
2727

2828
# Requirement arguments passed to pip and used by default or with --dev.
29-
REQUIREMENTS="--editable ."
30-
DEV_REQUIREMENTS="--editable .[testing]"
29+
REQUIREMENTS="--editable . --constraint requirements.txt"
30+
DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"
3131

3232
# where we create a virtualenv
33-
VIRTUALENV_DIR=tmp
33+
VIRTUALENV_DIR=venv
3434

3535
# Cleanable files and directories with the --clean option
3636
CLEANABLE="
3737
build
38-
tmp"
38+
venv"
3939

4040
# extra arguments passed to pip
4141
PIP_EXTRA_ARGS=" "
@@ -50,6 +50,12 @@ VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
5050
CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5151
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
5252

53+
# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
54+
if [ -f "$CFG_ROOT_DIR/thirdparty" ]; then
55+
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty "
56+
fi
57+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS --find-links https://thirdparty.aboutcode.org/pypi"
58+
5359

5460
################################
5561
# Set the quiet flag to empty if not defined
@@ -78,10 +84,14 @@ cli_help() {
7884
echo " usage: ./configure [options]"
7985
echo
8086
echo The default is to configure for regular use. Use --dev for development.
87+
echo Use the --init option if starting a new project and the project
88+
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
89+
echo and requirements.txt and/or requirements-dev.txt has not been generated.
8190
echo
8291
echo The options are:
8392
echo " --clean: clean built and installed files and exit."
8493
echo " --dev: configure the environment for development."
94+
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
8595
echo " --help: display this help message and exit."
8696
echo
8797
echo By default, the python interpreter version found in the path is used.
@@ -120,7 +130,7 @@ create_virtualenv() {
120130
VIRTUALENV_PYZ="$CFG_ROOT_DIR/etc/thirdparty/virtualenv.pyz"
121131
else
122132
VIRTUALENV_PYZ="$CFG_ROOT_DIR/$VENV_DIR/virtualenv.pyz"
123-
wget -O "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL"
133+
wget -O "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL" 2>/dev/null || curl -o "$VIRTUALENV_PYZ" "$VIRTUALENV_PYZ_URL"
124134
fi
125135

126136
$PYTHON_EXECUTABLE "$VIRTUALENV_PYZ" \
@@ -155,12 +165,22 @@ install_packages() {
155165
# Main command line entry point
156166
CFG_DEV_MODE=0
157167
CFG_REQUIREMENTS=$REQUIREMENTS
158-
159-
case "$CLI_ARGS" in
160-
--help) cli_help;;
161-
--clean) clean;;
162-
--dev) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
163-
esac
168+
NO_INDEX="--no-index"
169+
170+
# We are using getopts to parse option arguments that start with "-"
171+
while getopts :-: optchar; do
172+
case "${optchar}" in
173+
-)
174+
case "${OPTARG}" in
175+
help ) cli_help;;
176+
clean ) clean;;
177+
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
178+
init ) NO_INDEX="";;
179+
esac;;
180+
esac
181+
done
182+
183+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS $NO_INDEX"
164184

165185
create_virtualenv "$VIRTUALENV_DIR"
166186
install_packages "$CFG_REQUIREMENTS"

0 commit comments

Comments
 (0)