Skip to content

Commit

Permalink
Merge pull request #154 from Erotemic/dev/1.3.6
Browse files Browse the repository at this point in the history
Dev/1.3.6
  • Loading branch information
Erotemic committed Apr 26, 2024
2 parents 92fcc61 + b1d856c commit 1da8198
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 21 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- name: Typecheck with mypy
run: |-
python -m pip install mypy
pip install -r requirements/runtime.txt
mypy --install-types --non-interactive ./ubelt
mypy ./ubelt
build_and_test_sdist:
Expand Down Expand Up @@ -146,6 +147,7 @@ jobs:
path: ./wheelhouse/ubelt*.whl
test_purepy_wheels:
name: ${{ matrix.python-version }} on ${{ matrix.os }}, arch=${{ matrix.arch }} with ${{ matrix.install-extras }}
if: "! startsWith(github.event.ref, 'refs/heads/release')"
runs-on: ${{ matrix.os }}
needs:
- build_purepy_wheels
Expand All @@ -161,7 +163,7 @@ jobs:
arch: auto
- python-version: '3.6'
install-extras: tests-strict,runtime-strict
os: macOS-latest
os: macos-13
arch: auto
- python-version: '3.6'
install-extras: tests-strict,runtime-strict
Expand Down Expand Up @@ -327,6 +329,9 @@ jobs:
pip install tomli pkginfo
export WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('ubelt*.whl'))[-1]).replace(chr(92), chr(47)))")
export MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)")
echo "$WHEEL_FPATH=WHEEL_FPATH"
echo "$INSTALL_EXTRAS=INSTALL_EXTRAS"
echo "$MOD_VERSION=MOD_VERSION"
pip install --prefer-binary "ubelt[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse
echo "Install finished."
- name: Test wheel ${{ matrix.install-extras }}
Expand Down Expand Up @@ -385,9 +390,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && ! startsWith(github.event.ref, 'refs/tags') && ! startsWith(github.event.ref, 'refs/heads/release')
needs:
- build_and_test_sdist
- build_purepy_wheels
- test_purepy_wheels
- build_and_test_sdist
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
Expand Down Expand Up @@ -460,9 +464,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || startsWith(github.event.ref, 'refs/heads/release'))
needs:
- build_and_test_sdist
- build_purepy_wheels
- test_purepy_wheels
- build_and_test_sdist
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
Expand Down Expand Up @@ -550,6 +553,12 @@ jobs:
shell: bash
run: ls -la wheelhouse
- run: 'echo "Automatic Release Notes. TODO: improve" > ${{ github.workspace }}-CHANGELOG.txt'
- name: Tag Release Commit
if: (startsWith(github.event.ref, 'refs/heads/release'))
run: |-
export VERSION=$(python -c "import setup; print(setup.VERSION)")
git tag "v$VERSION"
git push origin "v$VERSION"
- uses: softprops/action-gh-release@v1
name: Create Release
id: create_release
Expand All @@ -558,8 +567,9 @@ jobs:
with:
body_path: ${{ github.workspace }}-CHANGELOG.txt
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
name: Release ${{ github.ref }}
body: Automatic Release
generate_release_notes: true
draft: true
prerelease: false
files: |-
Expand Down
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ We are currently working on porting this changelog to the specifications in
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
This project (loosely) adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Version 1.3.5 -
## Version 1.3.6 -

### Fixed:
* `ub.import_module_from_path` now correctly accepts `PathLike` objects.

## Version 1.3.5 - Released 2024-03-20

### Added:
* New wrapper around `pathlib.Path.chmod` in `ubelt.Path.chmod`. Can now
specify string codes like "u+x" or "+rw". Old stat logic works as it
previously did.

### Fixed:
* `ub.import_module_from_path` now correctly accepts `PathLike` objects.


### Changed:
* Allow the argument to `ubelt.cmd` to be a `PathLike` object, which we will
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ project. Note: this measure is biased towards older functions.
`ubelt.POSIX <https://ubelt.readthedocs.io/en/latest/auto/ubelt.util_platform.html#ubelt.util_platform.POSIX>`__ 0
`ubelt.DownloadManager <https://ubelt.readthedocs.io/en/latest/auto/ubelt.util_download_manager.html#ubelt.util_download_manager.DownloadManager>`__ 0
`ubelt.CaptureStream <https://ubelt.readthedocs.io/en/latest/auto/ubelt.util_stream.html#ubelt.util_stream.CaptureStream>`__ 0
================================================================================================================================================ ================
===================================================================================================================================================== ================



Expand Down
10 changes: 5 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
### For gitlab
The user will need to enable the repo on their readthedocs account:
https://readthedocs.org/dashboard/import/manual/?
To enable the read-the-docs go to https://readthedocs.org/dashboard/ and login
Make sure you have a .readthedocs.yml file
The user will need to enable the repo on their readthedocs account:
https://readthedocs.org/dashboard/import/manual/?
Click import project: (for github you can select, but gitlab you need to import manually)
Enter the following information:
Set the Repository NAME: ubelt
Set the Repository URL: https://github.com/Erotemic/ubelt
Make sure you have a .readthedocs.yml file
For gitlab you also need to setup an integrations. Navigate to:
https://readthedocs.org/dashboard/ubelt/integrations/create/
Expand Down
10 changes: 7 additions & 3 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
xdoctest >= 1.1.2
xdoctest >= 1.1.3

# Pin maximum pytest versions for older python versions
# TODO: determine what the actual minimum and maximum acceptable versions of
# pytest (that are also compatible with xdoctest) are for each legacy python
# major.minor version.
pytest>=6.2.5 ; python_version >= '3.10.0' # Python 3.10+
pytest>=8.1.1 ; python_version < '4.0' and python_version >= '3.13' # Python 3.13+
pytest>=8.1.1 ; python_version < '3.13' and python_version >= '3.12' # Python 3.12
pytest>=8.1.1 ; python_version < '3.12' and python_version >= '3.11' # Python 3.11
pytest>=6.2.5 ; python_version < '3.11' and python_version >= '3.10' # Python 3.10
pytest>=4.6.0 ; python_version < '3.10.0' and python_version >= '3.7.0' # Python 3.7-3.9
pytest>=4.6.0 ; python_version < '3.7.0' and python_version >= '3.6.0' # Python 3.6
pytest>=4.6.0, <= 6.1.2 ; python_version < '3.6.0' and python_version >= '3.5.0' # Python 3.5
Expand All @@ -21,7 +24,8 @@ pytest-cov>=2.8.1 ; python_version < '3.5.0' and python_version >= '3
pytest-cov>=2.8.1 ; python_version < '2.8.0' and python_version >= '2.7.0' # Python 2.7

# xdev availpkg pytest-timeout
pytest-timeout>=1.4.2
pytest_timeout>=2.3.1 ; python_version < '4.0' and python_version >= '3.12' # Python 3.13+
pytest_timeout>=1.4.2 ; python_version < '3.12' # Python 3.11-

# xdev availpkg xdoctest
# xdev availpkg coverage
Expand Down
2 changes: 1 addition & 1 deletion ubelt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
xdoctest ubelt
"""

__version__ = '1.3.5'
__version__ = '1.3.6'

# Deprecated functions
from ubelt.util_platform import (
Expand Down
4 changes: 3 additions & 1 deletion ubelt/util_str.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def paragraph(text):
Wraps multi-line strings and restructures the text to remove all newlines,
heading, trailing, and double spaces.
Useful for writing log messages
Useful for writing help strings, log messages, and natural text.
Args:
text (str): typically a multiline string
Expand All @@ -106,6 +106,8 @@ def paragraph(text):
>>> assert chr(10) not in out
>>> print('text = {!r}'.format(text))
>>> print('out = {!r}'.format(out))
text = '\n Lorem ipsum dolor sit amet, consectetur adipiscing\n elit, sed do eiusmod tempor incididunt ut labore et\n dolore magna aliqua.\n '
out = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'
"""
import re
out = re.sub(r'\s\s*', ' ', text).strip()
Expand Down
2 changes: 2 additions & 0 deletions ubelt/util_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
:mod:`pendulum` - https://github.com/sdispater/pendulum - drop in replacement for datetime
:mod:`arrow` - https://github.com/arrow-py/arrow
:mod:`kwutil.util_time` - https://kwutil.readthedocs.io/en/latest/auto/kwutil.util_time.html
"""
import time
import sys
Expand Down

0 comments on commit 1da8198

Please sign in to comment.