Skip to content

fix(build): migrate from setup.py to pyproject.toml #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ search = "__version__ = '{current_version}'"
replace = "__version__ = '{new_version}'"

[[tool.bumpversion.files]]
filename = "setup.py"
search = "__version__ = '{current_version}'"
replace = "__version__ = '{new_version}'"
filename = "pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[
"@semantic-release/exec",
{
"prepareCmd": "bump-my-version bump --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version}"
"prepareCmd": "bump-my-version bump --allow-dirty --verbose --current-version ${lastRelease.version} --new-version ${nextRelease.version}"
}
],
[
Expand Down
20 changes: 8 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ dist: jammy

stages:
- name: Build-Test
if: tag IS blank
- name: Semantic-Release
if: (branch = main) AND (type IN (push, api)) AND (fork = false)
- name: Publish-Release
if: (tag IS present) AND (fork = false)

# Default "install" and "script" steps.
install:
- pip install setuptools=="60.8.2"
install: true

script:
- make all
- make ci

jobs:
include:
Expand Down Expand Up @@ -44,12 +45,7 @@ jobs:
- stage: Publish-Release
python: "3.8"
name: Publish-To-PyPi
before_deploy:
- pip install bump-my-version
deploy:
- provider: pypi
setuptools_version: "60.8.2"
user: $PYPI_USER
password: $PYPI_TOKEN
repository: https://upload.pypi.org/legacy
skip_cleanup: true
script:
- make ci
- make publish-deps
- make publish-release
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include requirements.txt
include requirements-dev.txt
include LICENSE
34 changes: 24 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,30 @@
# example: "make setup"

PYTHON=python
LINT=black
LINT_DIRS=ibm_platform_services test/unit test/integration examples

setup: deps dev_deps install_project
setup: deps dev-deps install-project

all: upgrade_pip setup test-unit lint
all: upgrade-pip setup test-unit lint

ci: setup test-unit lint
ci: all

upgrade_pip:
publish-release: build-dist publish-dist

upgrade-pip:
${PYTHON} -m pip install --upgrade pip

deps:
${PYTHON} -m pip install -r requirements.txt
${PYTHON} -m pip install .

dev-deps:
${PYTHON} -m pip install .[dev]

dev_deps:
${PYTHON} -m pip install -r requirements-dev.txt
publish-deps:
${PYTHON} -m pip install .[publish]

install_project:
install-project:
${PYTHON} -m pip install -e .

test: test-unit test-int
Expand All @@ -36,7 +42,15 @@ test-examples:

lint:
${PYTHON} -m pylint ${LINT_DIRS}
black --check ${LINT_DIRS}
${LINT} --check ${LINT_DIRS}

lint-fix:
black ${LINT_DIRS}
${LINT} ${LINT_DIRS}

build-dist:
rm -fr dist
${PYTHON} -m build

# This target requires the TWINE_PASSWORD env variable to be set to the user's pypi.org API token.
publish-dist:
TWINE_USERNAME=__token__ ${PYTHON} -m twine upload --non-interactive --verbose dist/*
9 changes: 0 additions & 9 deletions codecov.yml

This file was deleted.

Loading