Skip to content

Commit

Permalink
Prepare for initial pypi release.
Browse files Browse the repository at this point in the history
- Fix a few bugs with tests.
- Update dependencies.
- Update toml format for updated Poetry.
- Update GH actions.
  • Loading branch information
sean committed Apr 26, 2023
1 parent 5ff3384 commit a9f63b3
Show file tree
Hide file tree
Showing 11 changed files with 1,045 additions and 1,079 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: ["3.9"]
poetry-version: ["1.4.2"]

steps:
- uses: actions/checkout@v2
Expand All @@ -22,12 +23,10 @@ jobs:
- name: Display Python version
run: python -c "import sys; print(f'Python {sys.version} on {sys.platform}')"

- name: Install Linux dependencies
run: |
./.github/ubuntu-install.sh
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Cache Poetry virtualenv
uses: actions/cache@v1
Expand All @@ -43,7 +42,7 @@ jobs:
poetry config virtualenvs.in-project true
- name: Install Dependencies (with Lint)
run: poetry install --no-dev -E tests -E lint
run: poetry install --all-extras

- name: Lint with flake8
run: "poetry run flake8 ."
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
poetry-version: ["1.4.2"]
steps:
- uses: actions/checkout@v1
- name: Set up Python-${{ matrix.python-version }} (Platform ${{ matrix.os }})
Expand All @@ -38,6 +39,8 @@ jobs:
python-version: 3.7
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Build sdist
run: poetry build -f sdist
- name: Store dist artifacts
Expand All @@ -62,6 +65,8 @@ jobs:
path: dist
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Publish to PyPI
run: poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD
env:
Expand Down
32 changes: 5 additions & 27 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
poetry-version: ["1.2.0"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
poetry-version: ["1.4.2"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
Expand Down Expand Up @@ -43,22 +43,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: python -c "import sys; print(f'Python {sys.version} on {sys.platform}')"

- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
./.github/ubuntu-install.sh
- name: Install macOS dependencies
if: startsWith(matrix.os, 'macos')
run: |
./.github/macos-install.sh
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
Expand All @@ -71,23 +60,12 @@ jobs:
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project true
poetry config experimental.new-installer true
- name: Set Poetry config (py3.10)
if: matrix.python-version > 3.9
run: |
poetry config experimental.new-installer false
- name: Install Dependencies
if: ${{ !(startsWith(matrix.os, 'macos') && matrix.python-version >= 3.9) }}
run: pip install -U setuptools && poetry install --no-dev -E tests

- name: Install Dependencies (MacOS + Py3.9)
if: ${{ startsWith(matrix.os, 'macos') && matrix.python-version >= 3.9 }}
run: |
OPENBLAS="$(brew --prefix openblas)" poetry install --no-dev -E tests
run: pip install -U setuptools && poetry install --all-extras

- name: Test with pytest
run: |
poetry run pytest tests yesql --doctest-modules --cov --cov-config=.coveragerc --cov-report=xml
poetry run pytest tests yesql --doctest-modules --cov --cov-config=.coveragerc --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down
9 changes: 8 additions & 1 deletion examples/pg/db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ SET row_security = off;
CREATE SCHEMA blog;


--
-- Name: public; Type: SCHEMA; Schema: -; Owner: -
--

-- *not* creating schema, since initdb creates it


--
-- Name: unaccent; Type: EXTENSION; Schema: -; Owner: -
--
Expand Down Expand Up @@ -138,7 +145,7 @@ ALTER SEQUENCE blog.posts_id_seq OWNED BY blog.posts.id;
--

CREATE TABLE public.schema_migrations (
version character varying(255) NOT NULL
version character varying(128) NOT NULL
);


Expand Down
2 changes: 1 addition & 1 deletion examples/pg/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
blog-db:
image: postgres:13
image: postgres:14.5
container_name: blog-db
restart: always
ports:
Expand Down
Loading

0 comments on commit a9f63b3

Please sign in to comment.