1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 20:52:43 +00:00

Compare commits

...

20 Commits
1.1.0 ... 1.2.0

Author SHA1 Message Date
Bastian Venthur
db30fe1d06 bumped version 2021-11-06 15:01:11 +01:00
Bastian Venthur
27a760d834 Merge pull request #17 from venthur/fix_autoreload
Fix autoreload
2021-11-06 15:00:08 +01:00
Bastian Venthur
a9abcd753a updated changelog 2021-11-06 14:59:53 +01:00
Bastian Venthur
3deb62ed88 Merge pull request #16 from venthur/dependabot/pip/twine-3.5.0
Bump twine from 3.4.2 to 3.5.0
2021-11-06 14:58:38 +01:00
Bastian Venthur
2366a2ae86 print the devserver URL to output 2021-11-06 14:57:37 +01:00
Bastian Venthur
0fb01e3249 updated changelog 2021-11-06 14:53:56 +01:00
Bastian Venthur
78316725cf remove warning in test due to threading race condition we don´t care
about
2021-11-06 14:51:46 +01:00
Bastian Venthur
4f1632e3cd Immediately rebuild once when entering autoreload 2021-11-06 14:12:57 +01:00
dependabot[bot]
d23f3666dc Bump twine from 3.4.2 to 3.5.0
Bumps [twine](https://github.com/pypa/twine) from 3.4.2 to 3.5.0.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/twine/compare/3.4.2...3.5.0)

---
updated-dependencies:
- dependency-name: twine
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-04 14:17:19 +00:00
Bastian Venthur
60cfd0290a updated changelog 2021-10-23 12:21:05 +02:00
Bastian Venthur
10ea8df1ac Merge pull request #12 from venthur/dependabot/pip/jinja2-3.0.2
Bump jinja2 from 3.0.1 to 3.0.2
2021-10-23 12:18:37 +02:00
Bastian Venthur
edc89581af Merge pull request #14 from venthur/dependabot/pip/pytest-cov-3.0.0
Bump pytest-cov from 2.12.1 to 3.0.0
2021-10-23 12:17:35 +02:00
dependabot[bot]
6d75891ace Bump pytest-cov from 2.12.1 to 3.0.0
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.12.1 to 3.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.12.1...v3.0.0)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-23 10:16:33 +00:00
Bastian Venthur
6367f5a55a Merge branch 'master' of github.com:venthur/blag 2021-10-23 12:16:06 +02:00
dependabot[bot]
3cd316a537 Bump jinja2 from 3.0.1 to 3.0.2
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.1...3.0.2)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-23 10:15:27 +00:00
Bastian Venthur
3b8d2fe9d6 Merge pull request #15 from venthur/dependabot/pip/flake8-4.0.1
Bump flake8 from 3.9.2 to 4.0.1
2021-10-23 12:15:06 +02:00
Bastian Venthur
1fe576a771 Merge pull request #13 from venthur/dependabot/pip/feedgenerator-2.0.0
Bump feedgenerator from 1.9.2 to 2.0.0
2021-10-23 12:14:39 +02:00
Bastian Venthur
2f4d2267a0 fixed typo in changelog 2021-10-23 12:08:13 +02:00
dependabot[bot]
7bb51ff060 Bump flake8 from 3.9.2 to 4.0.1
Bumps [flake8](https://github.com/pycqa/flake8) from 3.9.2 to 4.0.1.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/3.9.2...4.0.1)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 14:17:10 +00:00
dependabot[bot]
5a8012d62b Bump feedgenerator from 1.9.2 to 2.0.0
Bumps [feedgenerator](https://github.com/getpelican/feedgenerator) from 1.9.2 to 2.0.0.
- [Release notes](https://github.com/getpelican/feedgenerator/releases)
- [Changelog](https://github.com/getpelican/feedgenerator/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getpelican/feedgenerator/compare/1.9.2...2.0.0)

---
updated-dependencies:
- dependency-name: feedgenerator
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 14:23:13 +00:00
6 changed files with 71 additions and 9 deletions

View File

@@ -1,6 +1,17 @@
# Changelog
## [1.1.0] - 2021-1006
## [1.2.0] - 2021-11-06
* `make serve` now rebuilds immediately once after called to avoid serving
stale files
* updated dependencies:
* feedgenerator 2.0.0
* jinja2 3.0.1
* pytest-cov 3.0.0
* flake8 4.0.1
* twine 3.5.0
## [1.1.0] - 2021-10-06
* added Python 3.10 to list of supported versions to test against
* added dependabot to github workflows

View File

@@ -55,6 +55,9 @@ def autoreload(args):
last modified time). If the last modified time has changed, a
rebuild is triggered.
A rebuild is also performed immediately when this method is called
to avoid serving stale contents.
Parameters
----------
args : argparse.Namespace
@@ -62,12 +65,14 @@ def autoreload(args):
"""
dirs = [args.input_dir, args.template_dir, args.static_dir]
logger.info(f'Monitoring {dirs} for changes...')
last_mtime = get_last_modified(dirs)
# make sure we trigger the rebuild immediately when we enter the
# loop to avoid serving stale contents
last_mtime = 0
while True:
mtime = get_last_modified(dirs)
if mtime > last_mtime:
last_mtime = mtime
logger.debug('Change detected, rebuilding...')
logger.info('Change detected, rebuilding...')
blag.build(args)
time.sleep(1)
@@ -84,4 +89,5 @@ def serve(args):
directory=args.output_dir))
proc = multiprocessing.Process(target=autoreload, args=(args,))
proc.start()
logger.info("\n\n Devserver Started -- visit http://localhost:8000\n")
httpd.serve_forever()

View File

@@ -1 +1 @@
__VERSION__ = '1.1.0'
__VERSION__ = '1.2.0'

View File

@@ -1,6 +1,6 @@
sphinx==4.2.0
twine==3.4.2
twine==3.5.0
wheel==0.37.0
pytest==6.2.5
pytest-cov==2.12.1
flake8==3.9.2
pytest-cov==3.0.0
flake8==4.0.1

View File

@@ -1,4 +1,4 @@
markdown==3.3.4
feedgenerator==1.9.2
jinja2==3.0.1
feedgenerator==2.0.0
jinja2==3.0.2
pygments==2.10.0

View File

@@ -1,4 +1,7 @@
import time
import threading
import pytest
from blag import devserver
@@ -19,3 +22,45 @@ def test_get_last_modified(cleandir):
assert t2 > t1
assert t2 == t3
def test_autoreload_builds_immediately(args):
# create a dummy file that can be build
with open('content/test.md', 'w') as fh:
fh.write('boo')
t = threading.Thread(target=devserver.autoreload,
args=(args, ),
daemon=True,)
t0 = devserver.get_last_modified(['build'])
t.start()
# try for 5 seconds...
for i in range(5):
time.sleep(1)
t1 = devserver.get_last_modified(['build'])
print(t1)
if t1 > t0:
break
assert t1 > t0
@pytest.mark.filterwarnings("ignore::pytest.PytestUnhandledThreadExceptionWarning") # noqa
def test_autoreload(args):
t = threading.Thread(target=devserver.autoreload,
args=(args, ),
daemon=True,)
t.start()
t0 = devserver.get_last_modified(['build'])
# create a dummy file that can be build
with open('content/test.md', 'w') as fh:
fh.write('boo')
# try for 5 seconds to see if we rebuild once...
for i in range(5):
time.sleep(1)
t1 = devserver.get_last_modified(['build'])
if t1 > t0:
break
assert t1 > t0