Skip to content
This repository was archived by the owner on May 20, 2022. It is now read-only.

Commit ef0ec0c

Browse files
authored
Merge pull request #1 from fyndata/feature/project-setup
Basic project setup
2 parents 6e54c24 + 47a330b commit ef0ec0c

15 files changed

Lines changed: 313 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CircleCI 2.0 configuration file for this project.
2+
#
3+
# Notes:
4+
# - Do not use CircleCI's brand of Docker images unless it is for a secondary environment.
5+
# - We chose not to use dependencies caching because it is complicated to do it right and it is
6+
# not worth the effort for a project so small.
7+
#
8+
# For more information check out:
9+
# - https://circleci.com/docs/2.0/language-python/ for more details
10+
# - https://circleci.com/docs/2.0/configuration-reference/
11+
#
12+
version: 2
13+
jobs:
14+
build:
15+
docker:
16+
- image: python:3.7.1
17+
18+
working_directory: ~/repo
19+
20+
steps:
21+
- checkout
22+
23+
- run:
24+
name: install dependencies
25+
command: |
26+
python3 -m venv venv
27+
. venv/bin/activate
28+
pip install --upgrade pip
29+
pip install --upgrade setuptools wheel
30+
pip install -r requirements/test.txt
31+
# pip install -r requirements/extras.txt
32+
33+
# run tests!
34+
- run:
35+
name: run tests
36+
command: |
37+
. venv/bin/activate
38+
make lint
39+
make test-coverage
40+
make test-coverage-report-console
41+
make test-coverage-report-html
42+
make dist
43+
44+
- store_artifacts:
45+
path: test-reports
46+
destination: test-reports

.coveragerc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[run]
2+
source =
3+
fd_gcp/
4+
5+
branch = True
6+
7+
[report]
8+
exclude_lines =
9+
pragma: no cover
10+
if __name__ == .__main__.
11+
show_missing = True
12+
13+
[html]
14+
directory = test-reports/coverage/html

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include README.md
2+
3+
recursive-include tests *
4+
recursive-exclude * __pycache__
5+
recursive-exclude * *.py[co]
6+
7+
recursive-include docs *.md

Makefile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
SHELL = /usr/bin/env bash
2+
3+
.DEFAULT_GOAL := help
4+
.PHONY: help
5+
.PHONY: clean clean-build clean-pyc clean-test
6+
.PHONY: lint test test-all test-coverage test-coverage-report-console test-coverage-report-html
7+
.PHONY: dist install
8+
9+
define PRINT_HELP_PYSCRIPT
10+
import re, sys
11+
12+
for line in sys.stdin:
13+
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
14+
if match:
15+
target, help = match.groups()
16+
print("%-20s %s" % (target, help))
17+
endef
18+
export PRINT_HELP_PYSCRIPT
19+
20+
21+
help:
22+
@echo "Read README.md"
23+
@echo ""
24+
@echo "Makefile tasks:"
25+
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
26+
27+
clean: clean-build clean-pyc clean-test ## remove all build, test, lint, coverage and Python artifacts
28+
29+
clean-build: ## remove build artifacts
30+
rm -rf .eggs/
31+
rm -rf build/
32+
rm -rf dist/
33+
find . -name '*.egg-info' -exec rm -rf {} +
34+
find . -name '*.egg' -exec rm -f {} +
35+
36+
clean-pyc: ## remove Python file artifacts
37+
find . -name '*.pyc' -exec rm -f {} +
38+
find . -name '*.pyo' -exec rm -f {} +
39+
find . -name '*~' -exec rm -f {} +
40+
find . -name '__pycache__' -exec rm -rf {} +
41+
42+
clean-test: ## remove test, lint and coverage artifacts
43+
rm -rf .cache/
44+
rm -rf .tox/
45+
rm -f .coverage
46+
rm -rf htmlcov/
47+
rm -rf test-reports/
48+
rm -rf .mypy_cache/
49+
50+
lint: ## run tools for code style analysis, static type check, etc
51+
flake8 --config=setup.cfg fd_gcp tests
52+
mypy --config-file setup.cfg fd_gcp
53+
54+
test: ## run tests
55+
python setup.py test
56+
57+
test-all: ## run tests on every Python version with tox
58+
@echo "TODO: configure tox"
59+
60+
test-coverage: ## run tests and record test coverage
61+
coverage run setup.py test
62+
63+
test-coverage-report-console: ## print test coverage summary
64+
coverage report -m
65+
66+
test-coverage-report-html: ## generate test coverage HTML report
67+
coverage html
68+
69+
dist: clean ## builds source and wheel package
70+
python setup.py sdist
71+
python setup.py bdist_wheel
72+
ls -l dist
73+
74+
install: clean ## install the package to the active Python's site-packages
75+
python setup.py install

docs/.gitkeep

Whitespace-only changes.

fd_gcp/__init__.py

Whitespace-only changes.

fd_gcp/py.typed

Whitespace-only changes.

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file exists because many tools, services and platforms expect it to be
2+
# in the root directory of a Python project.
3+
-r requirements/release.txt

requirements/base.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# requirements common to all "run modes"
2+
# note: it is mandatory to register all dependencies of the required packages.
3+
4+
# Required packages:
5+
# None
6+
7+
# Packages dependencies:
8+
# None

requirements/release.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# note: it is mandatory to register all dependencies of the required packages.
2+
# (pro tip: keep to the minimum the number of packages declared here)
3+
-r base.txt
4+
5+
# Required packages:
6+
setuptools==40.6.3
7+
twine==1.12.1
8+
wheel==0.32.3
9+
10+
# Packages dependencies:
11+
# - twine:
12+
# - pkginfo
13+
# - readme-renderer
14+
# - bleach
15+
# - webencodings
16+
# - docutils
17+
# - Pygments
18+
# - six
19+
# - requests
20+
# - requests-toolbelt
21+
# - setuptools
22+
# - tqdm
23+
pkginfo==1.5.0.1
24+
readme-renderer==24.0
25+
requests==2.21.0
26+
requests-toolbelt==0.8.0
27+
tqdm==4.29.1

0 commit comments

Comments
 (0)