Skip to content

Commit

Permalink
Move building of wheel to noxfile.py
Browse files Browse the repository at this point in the history
Remove requirements.txt
  • Loading branch information
Spacetown committed Sep 22, 2021
1 parent 883f82e commit 7e05689
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox wheel
python -m pip install nox
- name: Lint with flake8
run: |
python -m nox --session lint
Expand All @@ -57,8 +57,7 @@ jobs:
python -m nox --session doc
- name: Build
run: |
python setup.py sdist bdist_wheel
twine check dist/*
python -m nox --session build_wheel
- name: Upload distribution
if: ${{ success() }}
uses: actions/upload-artifact@v2
Expand All @@ -71,4 +70,4 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
python -m nox --session upload_wheel
2 changes: 0 additions & 2 deletions admin/Dockerfile.qa
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ RUN \
apt-get clean

WORKDIR /gcovr
COPY requirements.txt .
COPY doc/requirements.txt doc/

ENV CC=$CC CXX=$CXX GCOVR_ISOLATED_TEST=zkQEVaBpXF1i

Expand Down
2 changes: 1 addition & 1 deletion doc/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sphinx.

The necessary python packages have to be installed, e.g. with pip:

pip install -r requirements.txt
pip install nox

The command

Expand Down
30 changes: 24 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ def lint(session):
else:
args = DEFAULT_TEST_DIRECTORIES
session.run("flake8", *args)

if session.posargs:
session.run("python", "-m", "black", *session.posargs)
else:
session.run(
"python", "-m", "black", "--diff", "--check", *BLACK_CONFORM_FILES
)
session.run("python", "-m", "black", "--diff", "--check", *BLACK_CONFORM_FILES)
session.run("python", "-m", "black", "--diff", *DEFAULT_TEST_DIRECTORIES)


Expand All @@ -73,7 +71,6 @@ def black(session):

@nox.session
def doc(session):
session.install("-r", "requirements.txt")
session.install("-r", "doc/requirements.txt")
session.install("-e", ".")
session.run("bash", "-c", "cd doc && make html O=-W", external=True)
Expand All @@ -97,7 +94,15 @@ def tests_all_versions(session):
@nox.session
@nox.parametrize("version", [nox.param(v, id=v) for v in GCC_VERSIONS])
def tests_version(session, version):
session.install("-r", "requirements.txt")
session.install(
"jinja2",
"lxml",
"pygments == 2.7.4",
"pytest",
"pytest-cov",
"cmake",
"yaxmldiff",
)
session.install("-e", ".")
set_environment(session, version)
session.run("bash", "-c", "cd gcovr/tests && make --silent clean", external=True)
Expand All @@ -110,6 +115,19 @@ def tests_version(session, version):
session.run("python", *args)


@nox.session
def build_wheel(session):
session.install("wheel", "twine")
session.run("python", "setup.py", "sdist", "bdist_wheel")
session.run("twine", "check", "dist/*", external=True)


@nox.session
def upload_wheel(session):
session.install("twine")
session.run("twine", "upload", "dist/*", external=True)


def docker_container_id(version):
return "gcovr-qa-{}".format(version)

Expand Down
13 changes: 0 additions & 13 deletions requirements.txt

This file was deleted.

0 comments on commit 7e05689

Please sign in to comment.