Repository: smartcar/python-sdk

Issue:
Changelog
Please keep a changelog summarizing user-facing issues so upgrades are easy to understand: https://keepachangelog.com/en/1.0.0/

Thanks :)

Discussion:

Patch:
diff --git a/.releaserc.js b/.releaserc.js
new file mode 100644
index 0000000..5c86c28
--- /dev/null
+++ b/.releaserc.js
@@ -0,0 +1,31 @@
+'use strict';
+
+module.exports = {
+  branches: 'master',
+  plugins: [
+    '@semantic-release/commit-analyzer',
+    [
+      '@google/semantic-release-replace-plugin',
+      {
+        replacements: [
+          {
+            files: ['smartcar/__init__.py'],
+            from: "__version__ = 'semantic-release'",
+            to: "__version__ = '${nextRelease.version}'",
+            results: [
+              {
+                file: 'smartcar/__init__.py',
+                hasChanged: true,
+                numMatches: 1,
+                numReplacements: 1,
+              },
+            ],
+            countMatches: true,
+          },
+        ],
+      },
+    ],
+    '@semantic-release/release-notes-generator',
+    '@semantic-release/github',
+  ],
+};
diff --git a/.travis.yml b/.travis.yml
index 0f47f2e..5d22b00 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,8 +8,7 @@ addons:
   apt:
     packages: firefox-geckodriver
 
-language:
-  - python
+language: python
 
 python:
   - '2.7'
@@ -30,33 +29,21 @@ script:
 
 jobs:
   include:
-    - stage: tag
-      language: generic
-      # no install necessary for generic language
-      install: true
-      script:
-        - git config --global user.email "ci@smartcar.com"
-        - git config --global user.name "Travis CI User"
-        - export tag=$(cat smartcar/__init__.py | grep '^__version__' | sed "s/^__version__[[:blank:]]*=[[:blank:]]'\(.*\)'/\1/g")
-        - if [ "$TRAVIS_BRANCH" = "master" ]; then git tag -a v$tag -m "Travis Generated Tag"; fi
-      deploy:
-        provider: script
-        skip_cleanup: true
-        script: echo -e "machine github.com\n  login $CI_USER_TOKEN" >> ~/.netrc && git push origin v$tag
-        on:
-          branch: master
-
     - stage: publish
-      language: python
-      python:
-        - '3.8'
-      # use 'true' to noop the install and script stageswhich are required for
-      # the python language
-      install: true
-      script: true
+      python: '3.8'
+      services: []
+      addons:
+        firefox: 'skip'
+        apt: []
+      install:
+        - nvm install 14
+        - npm install semantic-release@15.x.x @google/semantic-release-replace-plugin@1.x.x
+      script:
+        - npx semantic-release
+        - head -1 smartcar/__init__.py
       deploy:
         provider: pypi
-        user: $PYPI_USERNAME
+        username: $PYPI_USERNAME
         password: $PYPI_PASSWORD
         on:
           branch: master
diff --git a/smartcar/__init__.py b/smartcar/__init__.py
index 8f9d826..1ce06b1 100644
--- a/smartcar/__init__.py
+++ b/smartcar/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '4.3.3'
+__version__ = 'semantic-release'
 
 from .smartcar import (AuthClient, is_expired, get_user_id, get_vehicle_ids)
 from .vehicle import Vehicle


Test patch:
diff --git a/tests/test_requester.py b/tests/test_requester.py
index fe629f4..81bea65 100644
--- a/tests/test_requester.py
+++ b/tests/test_requester.py
@@ -28,7 +28,7 @@ class TestRequester(unittest.TestCase):
         smartcar.requester.call('GET', self.URL)
         self.assertRegexpMatches(
             responses.calls[0].request.headers['User-Agent'],
-            r'^Smartcar\/(\d+\.\d+\.\d+) \((\w+); (\w+)\) Python v(\d+\.\d+\.\d+)$')
+            r'^Smartcar\/semantic-release \((\w+); (\w+)\) Python v(\d+\.\d+\.\d+)$')
 
     @responses.activate
     def test_oauth_error(self):