Thinking Through a Licence Change for Your Package

Sooner or later, many maintainers wonder whether the licence they picked for their first release is the right one. Maybe a permissive licence feels too loose, maybe a copyleft licence is keeping companies away, or maybe the project started with no licence at all. Changing it is possible, but it is less like editing a file and more like renegotiating with everyone who has contributed. This post is general background, not legal advice; for a real change, talk to a lawyer.

Who actually owns the code

The first thing to understand is that a licence is granted by the copyright holders. If you wrote every line yourself, you can generally offer future versions under whatever terms you like. If other people contributed, they usually own the copyright in their contributions, and those contributions came to you under the project's existing licence.

That leaves a few common paths, each with different effort:

SituationTypical approach
Sole authorChange the licence for future releases
Contributors signed a CLA granting relicensing rightsThe project may be able to relicense under the agreement's terms
Contributions under the project licence onlyAsk every contributor for consent, or rewrite the code of those who do not agree
Moving to a licence the old one permits combining withSometimes new code can be added under the new licence while old code keeps its terms

The last row is where licence compatibility comes in, and it is the area where professional advice matters most.

Old versions keep their licence

A licence change applies to new releases. Versions already published remain available under the terms they were released with, and anyone who received them can keep using them on those terms. This is why licence changes sometimes lead to forks: people continue the last version under the old licence. Expect that possibility and do not treat it as hostile; it is how open source licences are designed to work.

Mechanics in the repository

When the decision is made, the practical changes are small but easy to get inconsistent:

  1. Replace the LICENSE file with the full text of the new licence.
  2. Update the metadata field: "license" in package.json, the license key in pyproject.toml, or the equivalent, using an identifier from the SPDX License List.
  3. Update any per-file headers, for example SPDX-License-Identifier comments.
  4. Record the change in the changelog, including the first version under the new licence.
  5. Update the README so the licence section matches.
// before
"license": "MIT"
// after (illustrative)
"license": "Apache-2.0"

Communicating it

A licence change affects how companies can use your package, so it deserves more than a changelog line. I would open an issue explaining the reasoning before the change, give contributors time to respond, and pin a short notice in the README for a few releases afterwards. Whether to treat the change as a major version is a judgement call; semver is about API compatibility, but a major bump is a clear signal that something important changed.

The Open Source Initiative lists approved licences, and choosealicense.com explains the common ones in plain language. Both are good places to start before involving a lawyer. See also the glossary for terms like copyleft and SPDX.

← Back to Home

Subscribe to Our Newsletter

Get the latest updates delivered to your inbox.