===========
 Changelog
===========

The Debian releases, from 1.2.2-1.1 on, follow ``debian/changelog``:
*unstable* marks a release, *UNRELEASED* a version still in development.
Earlier releases list the most notable changes by version.
For a full list, consult the `git history`_ of the project.

.. _`git history`: https://salsa.debian.org/python-team/packages/dh-virtualenv/-/commits/debian/master

1.3.2
=====

:Distribution: UNRELEASED
:Changed-By: Nico Della Torre

* Replace the build path in pyvenv.cfg, drop the direct_url.json
  files that pip writes with it for the projects installed from a
  local directory, and update in RECORD the hash and size of the
  scripts in bin/ once their build path is replaced, so that they
  no longer depend on the build directory. Also in the buildsystem.
* Drop the DebHelper call for Debian Squeeze: the class is the one of
  dh-virtualenv and always takes the options.
* Match nocheck as a whole word in DEB_BUILD_OPTIONS, not as a
  substring.
* Deployment: use tuples as default arguments instead of lists, and
  close the pip log file once the package is built.
* Recompile the bytecode of the virtualenv with the final path of its
  sources, instead of the build path that pip records in it, so
  tracebacks show the installed files and, with SOURCE_DATE_EPOCH, the
  .pyc files are reproducible (with a warning, the bytecode is kept
  for Python < 3.9). The buildsystem runs the same code, from the new
  dh_virtualenv.buildpath module.
* Depend on python3-virtualenv, which ships the virtualenv command,
  instead of "virtualenv | python3-virtualenv | python3-venv":
  python3-venv alone satisfied it, but only works with --builtin-venv.
  Recommend python3-venv for --builtin-venv.
* Buildsystem: add the prerm autoscript of dh_virtualenv, so the
  bytecode written at runtime is removed with the package.
* Add an autopkgtest that builds packages with the sequence,
  --builtin-venv and the buildsystem, offline, checks they hold no
  build path and are reproducible, then installs, uses and purges them.

1.3.1
=====

:Distribution: unstable, 2026-10-13
:Changed-By: Nico Della Torre

* Accept options passed by dh as -O--name=value: the lookup included
  the value, so --python and other options with a value given to dh
  were dropped and --builtin-venv failed with a TypeError.
  Closes: `#984767 <https://bugs.debian.org/984767>`__, `#845712 <https://bugs.debian.org/845712>`__

* doc/dh_virtualenv.1.rst: update the quick guide for maintainers
  (debhelper-compat 13, Python 3, no ${python:Depends}).
  Closes: `#856144 <https://bugs.debian.org/856144>`__

* Drop the lintian override for the pre-native changelog versions, no
  longer needed now that the previous entry is native.

* Use python3 for --builtin-venv when --python is not given, instead
  of failing with a TypeError. Closes: `#1150721 <https://bugs.debian.org/1150721>`__

* Replace the build path in all bin/activate* scripts instead of
  matching the VIRTUAL_ENV assignments: recent venv and virtualenv
  indent them, so bin/activate kept the build directory, and the csh
  and fish patterns also overwrote VIRTUAL_ENV_PROMPT.
  Closes: `#1150720 <https://bugs.debian.org/1150720>`__

* Buildsystem: replace the build path in all the scripts in bin/, not
  only in the shebangs, so the activate scripts and the console scripts
  that pip writes with a /bin/sh exec line for long build paths point
  to the installed virtualenv. Closes: `#1150722 <https://bugs.debian.org/1150722>`__

* Drop the .env autoenv development script: it is a third-party copy
  with no licence notice, wrongly covered by the Spotify AB stanza in
  debian/copyright, and is not shipped in the binary packages. Document
  building the documentation with Sphinx in README.md instead.

* Drop the Travis, tox and invoke development files, which target
  Python 2.7-3.8 with nose. README.md: run the tests with pytest and
  describe the current release steps.

* Dockerfile: install the build dependencies with apt-get build-dep
  instead of an outdated hardcoded list that no longer installed.

* Stop removing dh_python2, dh_pycentral and dh_pysupport from the
  sequence: no supported release has them. Fix the list of replaced
  commands and the position of dh_virtualenv in the documentation.

* doc: drop the Python 2 era instructions and --no-site-packages from
  the Python 3 recipe.

* Pass --setuptools=bundle to virtualenv for --setuptools: since
  virtualenv 20 the option takes a version, so the build failed with
  "the following arguments are required: dest". Closes: `#1150894 <https://bugs.debian.org/1150894>`__

* prerm: remove every __pycache__ directory of the virtualenv, not only
  the top-level one, so the bytecode Python writes at runtime does not
  stay behind after removal and purge. Closes: `#1150896 <https://bugs.debian.org/1150896>`__

* Publish the documentation on Salsa Pages with a pages job in
  debian/salsa-ci.yml, and link it from README.md and the man page
  instead of the Read the Docs project, still stuck at 1.2.2.

* doc/changes.rst: add the Debian releases from debian/changelog, with
  their distribution (unstable or UNRELEASED) and date, and point to
  the history on Salsa.

* doc: credit the Debian Python Team as maintainer and follow the
  Debian Code of Conduct.

* Buildsystem: report projects with only a pyproject.toml as buildable
  too (they were already installed with pip). doc: the project needs a
  pyproject.toml or a setup.py, and is installed with "pip install .".

* d/control: Build-Depend on python3-hatchling (>= 1.26), needed for the
  PEP 639 license fields in pyproject.toml (bookworm-backports has it).

* test: expect the DeprecationWarning of --pypi-url, --no-test and
  --setuptools-test in the tests that use them.

1.3
===

:Distribution: unstable, 2026-10-12
:Changed-By: Nico Della Torre

*Nico Della Torre*:

* Convert to a native package: upstream (spotify/dh-virtualenv) is
  inactive since 2020 and dh-virtualenv is a Debian-specific debhelper
  add-on. The former debian/patches are now regular commits in the
  tree.

* Build with pyproject.toml and hatchling instead of setuptools: drop
  setup.py, setup.cfg and _version.py, move bin/dh_virtualenv to
  dh_virtualenv/cli.py as a console_scripts entry point, keep the
  version in dh_virtualenv/__init__.py.

* d/control: Build-Depend on python3-hatchling and
  pybuild-plugin-pyproject instead of python3-setuptools.

* Bring back the Sphinx documentation in a new dh-virtualenv-doc
  package, built unless the nodoc build profile is active. Fix
  doc/conf.py for current Sphinx (no setup.py metadata, add_css_file,
  sphinx_rtd_theme without html_theme_path); the JavaScript files are
  handled by dh_sphinxdoc instead of libjs-jquery/libjs-underscore
  (with ${sphinxdoc:Built-Using}). Install doc/examples in
  dh-virtualenv-doc too.

* Drop Python 2 leftovers: u'' string prefixes, coding cookies,
  ``from __future__`` imports and explicit (object) base classes.

* d/copyright: point Source and Upstream-Contact to Salsa and the team,
  extend the Spotify years to 2013-2017, add Alexandre Detiste to
  debian/\*, drop the stray copyright line from the GPL-2+ license text.

* doc/tutorial.rst: modernize the packaging example (debhelper-compat 13,
  Python 3, current Standards-Version, no debian/compat) so Sphinx can
  highlight it again.

* doc/tutorial.rst: use apt instead of apt-get/dpkg -i/mk-build-deps in
  the interactive commands, replace the Stretch/Jessie installation notes
  and clone from Salsa.

* doc/examples: use a signed-by keyring instead of the removed apt-key
  for the NodeSource repository, drop apt-transport-https, switch to
  libncurses-dev and Node.js 22.

* doc: drop the unmaintained PPA, replace the "sudo pip install" advice
  (refused under PEP 668) with --upgrade-pip.

* d/control: drop the unused dh-exec Build-Depends, mark dh-virtualenv
  Multi-Arch: foreign, run the test suite as autopkgtest
  (Testsuite: autopkgtest-pkg-pybuild). Point Homepage to Salsa and drop
  the obsolete python3-virtualenv (>= 1.7) version constraint.

* Add a lintian override for the pre-native changelog versions.

*Alexandre Detiste*:

* wrap-and-sort -ast.

* Add debian/salsa-ci.yml.

* Drop old unused JavaScript Build-Depends.

* Use declarative dh-sequence-python3.

* Rewrite d/rules with the newer execute_before_* syntax.

* Drop the extraneous PYBUILD_TEST_PYTEST export.

1.2.2-3
=======

:Distribution: unstable, 2026-10-11
:Changed-By: Nico Della Torre

* Adopt package for the Debian Python Team (Closes: `#1141903 <https://bugs.debian.org/1141903>`__)

  - Set Maintainer to the Debian Python Team, add myself to Uploaders.

  - Point Vcs-* to salsa python-team/packages.

* New patches:

  - 0006: port the test suite from nose to pytest. nose does not import
    on Python >= 3.12 and is gone from Debian.

  - 0007: also detect an activated venv (sys.base_prefix, $VIRTUAL_ENV),
    not only virtualenv < 20.

  - 0008: deprecate --setuptools-test and stop with a clear error when the
    virtualenv's setuptools (>= 72) no longer provides ``setup.py test``.

  - 0009: buildsystem: drop --no-site-packages (removed in virtualenv 20),
    skip the ``setup.py test`` step when unavailable, add the missing "/"
    so shebangs are fixed when DH_VIRTUALENV_INSTALL_SUFFIX is set.

  - 0010: also remove dh_auto_configure from the python-virtualenv
    sequence, which failed with debhelper compat >= 12.

  - 0011: buildsystem: do not resolve symlinks when locating the venv's
    python, so pip runs inside the virtualenv with virtualenv >= 20.

  - 0012: apply DH_VERBOSE=1 once in the option parser instead of in
    both bin/dh_virtualenv and Deployment.from_options.

  - 0013: handle deprecated options through a table and one callback per
    option group.

  - 0014: skip binary packages whose Architecture does not match the
    host architecture, like debhelper.

  - 0015: drop the dead compile_all/rtupdate code inherited from
    dh_python2.

  - 0016: run the shebang-fixing sed only once instead of also starting
    a second, never awaited copy that raced with it.

* d/control: Build-Depend on python3-pytest <!nocheck>.

* d/rules: run the test suite with pytest.

1.2.2-2
=======

:Distribution: unstable, 2026-07-13
:Changed-By: Andreas Tille

* QA upload.

* Orphan package

* Maintain in Debian team on Salsa

* Bump debhelper from old 12 to 13.

* Remove redundant Priority: optional from source stanza.

* Replace FSF postal address with a reference to
  https://www.gnu.org/licenses/.

* Update standards version to 4.7.4, no changes needed.

* d/watch: version=5

* Remove ``Rules-Requires-Root: no`` since its default

* d/copyright: review

1.2.2-1.8
=========

:Distribution: unstable, 2026-05-29
:Changed-By: Arnaud Rebillout

* Non-maintainer upload.

* Cherry-pick upstream patch: only use -O options if option is supported

* Add patch to fix support of -a option (for --no-arch-all builds)

1.2.2-1.7
=========

:Distribution: unstable, 2025-05-04
:Changed-By: Ferenc Wágner

* Non-maintainer upload.

* Cherry-pick upstream patch fixing venv options (Closes: `#1104696 <https://bugs.debian.org/1104696>`__)

1.2.2-1.6
=========

:Distribution: unstable, 2024-07-14
:Changed-By: Graham Inggs

* Non-maintainer upload

* Depend on unversioned python3-venv from python3-defaults instead of
  the versioned package, to avoid needing a sourceful upload for every
  Python transition

1.2.2-1.5
=========

:Distribution: unstable, 2024-06-09
:Changed-By: Alexandre Detiste

* Non-maintainer upload.

* Remove extraneous python3-mock build depedency.

1.2.2-1.4
=========

:Distribution: unstable, 2023-11-17
:Changed-By: Uwe Kleine-König

* Non-maintainer upload.

* Drop Sphinx docs (Closes: `#1042646 <https://bugs.debian.org/1042646>`__)

1.2.2-1.3
=========

:Distribution: unstable, 2023-02-02
:Changed-By: Kunal Mehta

* Non-maintainer upload.

* Cherry-pick upstream patch for Python 3.11 support (Closes: `#1030170 <https://bugs.debian.org/1030170>`__)

1.2.2-1.2
=========

:Distribution: unstable, 2022-08-25
:Changed-By: Kunal Mehta

* Non-maintainer upload.

* Rebuild to update python3.x-venv dependency. (Closes: `#1017046 <https://bugs.debian.org/1017046>`__)

1.2.2-1.1
=========

:Distribution: unstable, 2021-03-08
:Changed-By: Vincent Bernat

* NMU.

* Rebuild to update python3.X-venv dependency. Closes: `#984766 <https://bugs.debian.org/984766>`__.


1.2.2
=====

* Bugfix release: Addresses removal of python3-venv on Debian testing/sid

1.2.1
=====

* Bugfix release: Fixes a binary dependency to depend on Python 3 version of virtualenv

1.2
===

* Requires Python 3 to build (`#300 <https://github.com/spotify/dh-virtualenv/issues/300>`_) [`@richvdh <https://github.com/richvdh>`_]
* Removed deprecated / disappeared virtualenv option (`#293 <https://github.com/spotify/dh-virtualenv/issues/293>`_)
  [`@jhermann <https://github.com/jhermann>`_]
* Add support for DEB_BUILD_OPTIONS=nodoc (`#289 <https://github.com/spotify/dh-virtualenv/issues/289>`_) [`@mgagne <https://github.com/mgagne>`_]
* Support venv options for builtin venv (`#276 <https://github.com/spotify/dh-virtualenv/issues/276>`_) [`@paulbovbel <https://github.com/paulbovbel>`_]
* New option :option:`--upgrade-pip-to` for increased build stability
  (#266) [`@jhermann <https://github.com/jhermann>`_]


1.1
===

* Support new style shebangs generated by recent pip (`#226 <https://github.com/spotify/dh-virtualenv/issues/226>`_) [`@nailor <https://github.com/nailor>`_]
* Add :option:`--extras` option (`#243 <https://github.com/spotify/dh-virtualenv/issues/243>`_) [`@jhermann <https://github.com/jhermann>`_]
* Python 3.4 and 3.5 added to test environments (`#238 <https://github.com/spotify/dh-virtualenv/issues/238>`_) [`@jhermann <https://github.com/jhermann>`_]
* New build dependendcies (dh-exec + python-sphinx-rtd-theme) (`#231 <https://github.com/spotify/dh-virtualenv/issues/231>`_) [`@labeneator <https://github.com/labeneator>`_]
* Disallow building a package whilst within an activated virtualenv (`#224 <https://github.com/spotify/dh-virtualenv/issues/224>`_) [`@lamby <https://github.com/lamby>`_]
* Use ``python -m pip`` instead of direct pip calls (`#219 <https://github.com/spotify/dh-virtualenv/issues/219>`_) [`@moritz <https://github.com/moritz>`_]
* Ignore :option:`--extra-pip-arg` in call for :option:`--upgrade-pip` (`#197 <https://github.com/spotify/dh-virtualenv/issues/197>`_) [`@jhermann <https://github.com/jhermann>`_]
* buildsystem: Allow to specify a virtualenv name (`#180 <https://github.com/spotify/dh-virtualenv/issues/180>`_) [`@dzen <https://github.com/dzen>`_]
* docs: Improved structure, new chapters [`@jhermann <https://github.com/jhermann>`_]
* docs: Fix reference to pbuilder's USENETWORK option (`#246 <https://github.com/spotify/dh-virtualenv/issues/246>`_) [`@mkohler <https://github.com/mkohler>`_]
* Fix setuptools and pip setup when using built-in virtualenv with
  `--system-site-packages` (`#247 <https://github.com/spotify/dh-virtualenv/issues/247>`_) [`@lucasrangit <https://github.com/lucasrangit>`_]


1.0
===

* **Backwards incompatible** Change the default install root to
  ``/opt/venvs``. This is due to the old installation root
  (``/usr/share/python``) clashing with Debian provided Python
  utilities. To maintain the old install location, use
  :envvar:`DH_VIRTUALENV_INSTALL_ROOT` and point it to
  ``/usr/share/python``.
* **Backwards incompatible** By default, do not run `setup.py test`
  upon building. The :option:`--no-test` flag has no longer has any
  effect. To get the old behaviour, use the
  :option:`--setuptools-test` flag instead.
* **Backwards incompatible** Buildsystem: Move files into build folder
  in install step instead of build step. Thanks to `Ludwig Hähne
  <https://github.com/Pankrat>`_ for the patch!
* Deprecate :option:`--pypi-url` in favour of :option:`--index-url`
* Support upgrading pip to the latest release with :option:`--upgrade-pip`
  flag.
* Buildsystem: Add support for :envvar:`DH_UPGRADE_PIP`,
  :envvar:`DH_UPGRADE_SETUPTOOLS` and :envvar:`DH_UPGRADE_WHEEL`. Thanks
  to `Kris Kvilekval <https://github.com/kkvilekval>`_ for the
  implementation!
* Buildsystem: Add support for custom requirements file location
  using :envvar:`DH_REQUIREMENTS_FILE` and for custom ``pip`` command
  line arguments using :envvar:`DH_PIP_EXTRA_ARGS`. Thanks to `Einar
  Forselv <https://github.com/einarf>`_ for implementing!
* Fixing shebangs now supports multiple interpreters. Thanks `Javier
  Santacruz <https://github.com/jvrsantacruz>`_!
* Allow a custom pip executable via :option:`--pip-tool` flag. Thanks
  `Anthony Sottile <https://github.com/asottile>`_ for the
  implementation!
* Fix handling of shebang lines for cases where interpreter was
  wrapped in quotes. Thanks to `Kamil Niechajewicz
  <https://github.com/noizex>`_ for fixing!
* Support extra arguments to be passed at virtualenv using
  :option:`--extra-virtualenv-arg`. Thanks to `Julien Duponchelle
  <https://github.com/noplay>`_ for the fix.

0.11
====

* Allow passing explicit filename for `requirements.txt` using
  :option:`--requirements` option. Thanks to `Eric Larson
  <https://github.com/ionrock>`_ for implementing!
* Ensure that venv is configured before starting any daemons. Thanks
  to `Chris Lamb <https://github.com/lamby>`_ for fixing this!
* Make sure `fix_activate_path` updates all activate scripts. Thanks
  to `walrusVision <https://github.com/walrusVision>`_ for fixing
  this!

0.10
====

* **Backwards incompatible** Fix installation using the built-in
  virtual environment on 3.4. This might break installation on Python
  versions prior to 3.4 when using :option:`--builtin-venv` flag.
  Thanks to `Elonen <https://github.com/elonen>`_ for fixing!
* Honor :envvar:`DH_VIRTUALENV_INSTALL_ROOT` in build system. Thanks to
  `Ludwig Hähne <https://github.com/Pankrat>`_ for implementing!
* Allow overriding virtualenv arguments by using the
  :envvar:`DH_VIRTUALENV_ARGUMENTS` environment variable when using the
  build system. Thanks to `Ludwig Hähne <https://github.com/Pankrat>`_
  for implementing!
* Add option to skip installation of the actual project. In other
  words using :option:`--skip-install` installs only the dependencies
  of the project found in requirements.txt. Thanks to `Phillip
  O'Donnell <https://github.com/phillipod>`_ for implementing!
* Support custom installation suffix instead of the package name via
  :option:`--install-suffix`. Thanks to `Phillip O'Donnell
  <https://github.com/phillipod>`_ for implementing!

0.9
===

* Support using system packages via a command line flag
  :option:`--use-system-packages`. Thanks to `Wes Mason
  <https://github.com/1stvamp>`_ for implementing this feature!
* Introduce a new, experimental, more modular build system. See the
  :doc:`usage` for documentation.
* Respect the :envvar:`DEB_NO_CHECK` environment variable.

0.8
===

* Support for running triggers upon host interpreter update. This new
  feature makes it possible to upgrade the host Python interpreter
  and avoid breakage of all the virtualenvs installed with
  dh-virtualenv. For usage, see the the :doc:`tutorial`. Huge thanks to
  `Jürgen Hermann <https://github.com/jhermann>`_ for implementing
  this long wanted feature!
* Add support for the built-in ``venv`` module. Thanks to `Petri
  Lehtinen <https://github.com/akheron>`_!
* Allow custom ``pip`` flags to be passed via the
  :option:`--extra-pip-arg` flag. Thanks to `@labeneator
  <https://github.com/labeneator>`_ for the feature.

0.7
===

* **Backwards incompatible** Support running tests. This change
  breaks builds that use distutils. For those cases a flag
  :option:`--no-test` needs to be passed.
* Add tutorial to documentation
* Don't crash on debbuild parameters ``-i`` and ``-a``
* Support custom source directory (debhelper's flag ``-D``)

0.6
===

First public release of *dh-virtualenv*
