Publish a package to the Platform

Publishing your package to the ActiveState catalog allows the Platform to build the package and make it available to everyone in your organization. This is currently only available for Linux users.

Ensure the following conditions are met before you begin

  • The State Tool is installed
  • Your State Tool is authorized
  • You have a .tar file of the source code of your package

The following will walk you through the process of


Publishing your proprietary package using the command line

To publish to the ActiveState Platform

  1. Open a command terminal and enter the directory containing your package’s source code. If the file is not currently stored as a .tar file, convert it to a tar file
  2. Open a text editor and create a configuration file containing the code sample shown below and save it to your working directory
    • The contents of this file will be pasted as a command into your terminal
    • Save this information somewhere on your system for verification and documentation
    • NOTE: A unique namespace is required for each language. Multiple ActiveState projects can use the same namespace, provided they are using the same language.
    • NOTE: Features must be listed twice. The first is to designate your package as something that can be used by your private org, the second is to tell the ActiveState solver where to look for your version of that package.
state publish \ 
--namespace private/<orgname>/<language> \
--name <package-name> \
--version <version-number> \
--description "<package-description>" \
--author "name <<email>> \ 
--depend "<builder/python-module-builder@>=0>" \
--feature private/<org-name>/<language>/<package-name>@<version-number> \
--feature language/<language>/<package-name>@<version-number> \
<file-name>
  • Replace placeholder values in the angled brackets with the details from your package (note the double angled brackets around email, one set must remain in the final code)
    • file-name, namespace, package-name, version-number and builder dependency with the --depend flag are all necessary for a successful publication.
  • Depending on the active requests sent to the Platform and available resources, this may take 10 mins for your package to be available
  • If your package contains more than one dependency, add as many as needed by writing additional --depend lines

Example: if you want to use a custom version of the python package django, your command should appear as follows:

state publish \ 
--namespace private/<orgname>/python \
--name django \
--version 5.1.8 \
--description "<package-description>" \
--author "name <<email>> \ 
--depend "<builder/python-module-builder@>=0>" \
--depend "<language/python/setuptools@>=75.8.1>" \
--feature private/<org-name>/python/django@5.1.8 \
--feature language/python/django@5.1.8 \
<file-name>

Note the two --depend... lines.

  • The first --depend line defines the builder required to build your django project
  • The second --depend line gives the builder a list of dependencies required to build the project. This information comes directly from the pyproject.toml found on the repository for django 5.1.8.

Running this command will publish your package to the ActiveState Platform.

Wait for a confirmation message in your terminal. If prompted, press y to confirm.


Publishing your proprietary package using a yaml file

To publish to the ActiveState Platform using your project’s .yaml file

  1. Open a command terminal and enter the directory containing your package’s source code. Note: the file must be stored as a .tar file.
  2. Create a yaml file containing the code sample shown below and save it to your working directory
    • The contents of this file will be run a command into your terminal. Save this file somewhere on your system for verification and documentation.
name: <package-name>
namespace: private/<orgname>/<language>
version: "<version-number>"
description: <package-description>
authors:
    - name: <author-name>
      email: <author-email>
dependencies:
    - dependency:
        name: <dependency-name>
        namespace: <dependency-namespace>
        versionRequirements: '>=0'
features:
    - name: <package-name>
      namespace: private/<orgname>/<language>
      version: "<version-number>"
  1. Replace placeholder values in the angled brackets with the details from your project/package
    • Depending on the active requests sent to the Platform and available resources, this may take 10 mins for your package to be available
    • If your package contains more than one dependency, add as many as needed by writing additional --depend lines

Example: if you want to use a custom version of the python package django, your command should appear as follows:

name: django
namespace: private/<orgname>/python
version: "5.1.8"
description: <package-description>
authors:
    - name: <author-name>
      email: <author-email>
dependencies:
    - dependency:
        name: python-module-builder
        namespace: builder
        versionRequirements: '>=0'
    - dependency:
        name: setuptools
        namespace: language/python
        versionRequirements: '>=75.8.1'
features:
    - name: django
      namespace: private/<orgname>/python
      version: "5.1.8"
    - name: django
      namespace: language/python
      version: "5.1.8"

After completing the file and saving it to your working directory, enter the following into your command line to publish the package to the ActiveState Platform

state publish --meta <yaml-file>.yaml <package-file>

For example

state publish --meta my-project.yaml TAR_FILE.tar.gz

Using your newly published package in your project

Your package is now available on the ActiveState Platform. To install your package to your local system, either create a secure shell environment using

state shell <orgname>/<projectname>

Or begin using a previously checked-out project by entering

state use <orgname>/<projectname>

Install the newly published package to the runtime environment by entering

state install <package-name>

Your package is now installed to your project and available to use. Note that publishing a new package may cause other packages in your project to be rebuilt, leading to a longer build time.

Troubleshooting

Python Wheels

If you choose to upload a python wheel, the file name of the wheel must conform to the standards described here. For example, if you upload a patched version of django 5.1.8, you must name your django wheel “Django-5.1.8”. This allows the ActiveState Platform to find and build from your wheel.