Skip to content

Commit 80d9152

Browse files
authored
Merge pull request #3 from stephen-zhao/develop/ou/20220127
Develop/ou/20220127
2 parents 9f654a0 + 0a2998d commit 80d9152

File tree

11 files changed

+76
-27
lines changed

11 files changed

+76
-27
lines changed

MANIFEST.in

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# ==================== Files to include in the sdist ====================
2+
3+
# config for project's main runnable dev automations
4+
include Makefile
5+
6+
# Minimum Build System spec (PEP-517/PEP-518)
7+
include pyproject.toml
8+
9+
# This file, to specify what goes into the source distribution
10+
include MANIFEST.in
11+
12+
# Setup for building the project's bdist
13+
include setup.cfg
14+
15+
# Requirements for running the project
16+
include requirements.in
17+
18+
# Requirements for running the build system and other dev tools
19+
include requirements-devtime.in
20+
21+
# Project Files
22+
include LICENSE
23+
include README*
24+
25+
# Typed marker (PEP-561)
26+
recursive-include src/ py.typed
27+
28+
# Include test configuration
29+
include test/conftest.py
30+
31+
prune .venv

Makefile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PY_EXE_PATH ?= $(shell which python3.9 || which python3.8 || which python3.7 || which python3.6 || which python3)
1+
PY_EXE_PATH ?= $(shell which python3.10 || which python3.9 || which python3.8 || which python3.7 || which python3.6 || which python3)
22
PY_EXE := $(shell basename $(PY_EXE_PATH))
33

44
VENV_DIR := .venv
@@ -58,8 +58,8 @@ $(MARKER_PIPTOOLS): $(MARKER_VENV)
5858

5959
# Requirements input files
6060
INPUT_DISTTIME_REQUIREMENTS_FILENAME := requirements.in
61-
INPUT_DEVTIME_REQUIREMENTS_FILENAMES := $(wildcard requirements-devtime.d/*.in)
62-
ALL_INPUT_REQUIREMENTS_FILENAMES := $(INPUT_DISTTIME_REQUIREMENTS_FILENAME) $(INPUT_DEVTIME_REQUIREMENTS_FILENAMES)
61+
INPUT_DEVTIME_REQUIREMENTS_FILENAME := requirements-devtime.in
62+
ALL_INPUT_REQUIREMENTS_FILENAMES := $(INPUT_DISTTIME_REQUIREMENTS_FILENAME) $(INPUT_DEVTIME_REQUIREMENTS_FILENAME)
6363

6464
# Resolve and then Sync requirements
6565

@@ -179,7 +179,7 @@ black-fix: $(MARKER_REQUIREMENTS_SYNCED_DEVTIME)
179179
.PHONY: mypy
180180
mypy: # Run mypy type-checker
181181
mypy: $(MARKER_REQUIREMENTS_SYNCED_DEVTIME)
182-
$(PY_IN_VENV_EXE) -m mypy --config-file setup.cfg $(package_dir)
182+
$(PY_IN_VENV_EXE) -m mypy --config-file setup.cfg --namespace-packages -p $(package)
183183

184184

185185
# ==================== Building ====================
@@ -193,17 +193,21 @@ build: $(MARKER_REQUIREMENTS_SYNCED_DEVTIME)
193193

194194
.PHONY: test
195195
test: $(MARKER_REQUIREMENTS_SYNCED_DEVTIME)
196-
$(PY_IN_VENV_EXE) -m pytest --cov=. --cov-fail-under=$(coverage_percent) --cov-config=setup.cfg --cov-report=xml:coverage.xml --cov-report=term-missing --cov-branch $(package_dir) $(test_dir)
196+
$(PY_IN_VENV_EXE) -m pytest --cov=src --cov-fail-under=$(coverage_percent) --cov-config=setup.cfg --cov-report=xml:coverage.xml --cov-report=term-missing --cov-branch $(package_dir) $(test_dir)
197197

198198

199199
# ==================== Publishing ====================
200200

201+
.PHONY: pre-publish
202+
pre-publish:
203+
$(PY_IN_VENV_EXE) -m twine check dist/*
204+
201205
.PHONY: publish
202-
publish:
206+
publish: pre-publish
203207
$(PY_IN_VENV_EXE) -m twine upload dist/*
204208

205209
.PHONY: publish-test
206-
publish-test:
210+
publish-test: pre-publish
207211
$(PY_IN_VENV_EXE) -m twine upload --repository testpypi dist/*
208212

209213

requirements-devtime.d/build.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements-devtime.d/lint.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

requirements-devtime.d/publish.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements-devtime.d/test.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements-devtime.in

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# lint
2+
isort
3+
mypy
4+
flake8
5+
black
6+
7+
# build
8+
build
9+
10+
# test
11+
pytest
12+
pytest-cov
13+
14+
# publish
15+
twine
16+
17+
# self
18+
-e .

requirements-devtime.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
5-
# pip-compile --output-file=requirements-devtime.txt requirements-devtime.d/build.in requirements-devtime.d/lint.in requirements-devtime.d/publish.in requirements-devtime.d/test.in requirements.in
5+
# pip-compile --output-file=requirements-devtime.txt requirements-devtime.in requirements.in
66
#
77
-e file:///mnt/c/Projects/Dev/datetime_matcher
8-
# via -r requirements-devtime.d/test.in
8+
# via -r requirements-devtime.in
99
attrs==21.4.0
1010
# via pytest
1111
black==21.12b0
12-
# via -r requirements-devtime.d/lint.in
12+
# via -r requirements-devtime.in
1313
bleach==4.1.0
1414
# via readme-renderer
1515
build==0.7.0
16-
# via -r requirements-devtime.d/build.in
16+
# via -r requirements-devtime.in
1717
certifi==2021.10.8
1818
# via requests
1919
cffi==1.15.0
@@ -31,7 +31,7 @@ cryptography==36.0.1
3131
docutils==0.18.1
3232
# via readme-renderer
3333
flake8==4.0.1
34-
# via -r requirements-devtime.d/lint.in
34+
# via -r requirements-devtime.in
3535
idna==3.3
3636
# via requests
3737
importlib-metadata==4.10.1
@@ -41,7 +41,7 @@ importlib-metadata==4.10.1
4141
iniconfig==1.1.1
4242
# via pytest
4343
isort==5.10.1
44-
# via -r requirements-devtime.d/lint.in
44+
# via -r requirements-devtime.in
4545
jeepney==0.7.1
4646
# via
4747
# keyring
@@ -51,7 +51,7 @@ keyring==23.5.0
5151
mccabe==0.6.1
5252
# via flake8
5353
mypy==0.931
54-
# via -r requirements-devtime.d/lint.in
54+
# via -r requirements-devtime.in
5555
mypy-extensions==0.4.3
5656
# via
5757
# black
@@ -85,10 +85,10 @@ pyparsing==3.0.7
8585
# via packaging
8686
pytest==6.2.5
8787
# via
88-
# -r requirements-devtime.d/test.in
88+
# -r requirements-devtime.in
8989
# pytest-cov
9090
pytest-cov==3.0.0
91-
# via -r requirements-devtime.d/test.in
91+
# via -r requirements-devtime.in
9292
readme-renderer==32.0
9393
# via twine
9494
requests==2.27.1
@@ -115,7 +115,7 @@ tomli==1.2.3
115115
tqdm==4.62.3
116116
# via twine
117117
twine==3.7.1
118-
# via -r requirements-devtime.d/publish.in
118+
# via -r requirements-devtime.in
119119
typing-extensions==4.0.1
120120
# via
121121
# black

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = datetime-matcher
3-
version = 0.2.0
3+
version = attr: datetime_matcher.__version__
44
author = Stephen Zhao
55
author_email = mail@zhaostephen.com
66
description = A library which extends regex with support for datetime format codes.
@@ -40,6 +40,7 @@ keywords =
4040
match
4141

4242
[options]
43+
include_package_data = True
4344
package_dir =
4445
= src
4546
packages = find:

src/datetime_matcher/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
# Semantic Version
2+
__version__ = "0.2.1"
3+
4+
# Make public names available at top level
15
from .datetime_matcher import DatetimeMatcher

0 commit comments

Comments
 (0)