Skip to main content

Convert .pbs files to Python dicts

Project description

SSRA Book: Standard Style Rules & Advisories

Chapter 1: Readability

R/1

Add an empty line between sections, as shown in the following example:

[container;main]

[main;setup]
// ...

[main;build]
// ...

// This comment is not related to the rest of the file

[end_container;main]

R/2

Name the first container main:

[container;main]

// ...

[end_container;main] R/3

Add a space between // and the comment text:

//wrong
// correct

R/4

Place build first and setup last (when creating a file for pybuild-xtra):

[container;main]

[main;build]
- name = "project"
- version = "1.0"
- ai_description = false
- description = "project"
- autoupload = true

[main;setup]
- use = "pyproject.toml"
- custom_readme_name = false

[setup;dependencies]
    "something",

[end_container;main]

R/5

If there is no specific reason, do not add comments.

Reason: this file is usually only for you. You already know what and why something exists, and the lexer ignores comments anyway.

Wrong:

// ...

// making build because it is required
[main;build]
// project name
- name = "my_cool_project" // it is named this because...
// version
- version = "1.0" // yay, new release: ...

// ...

Correct:

// ...

[main;build]
- name = "my_cool_project"
- version = "1.0" // Finally

// ...

Note: This rule is the least important because it depends on personal preference. It is only a recommendation. One or two small comments are completely fine.

Chapter 2: Syntax (pybuild-xtra file creation)

S/1

Do not use spaces in project names:

// ...

[main;build]
- name = "my cool project" // Oops! Invalid for PyPI

// ...

S/2

(Repeats R/4) Place build first and setup last:

[container;main]

[main;build]

  • name = "project"
  • version = "1.0"
  • ai_description = false
  • description = "project"
  • autoupload = true

[main;setup]

  • use = "pyproject.toml"
  • custom_readme_name = false

[setup;dependencies] "something",

[end_container;main] S/3


Use the pyproject.toml format:

```pbs
// ...

[main;setup]
- use = "pyproject.toml"

// ...

Chapter 3: Naming

N/1

Use lowercase names.

// ...

[main;setup]
- Use = "pyproject.toml" // Correct, but you pressed CAPS LOCK twice

// ...

[main;setup]
- use = "pyproject.toml" // Correct

// ...

N/2

Use short names only.

(custom_readme_name is currently an exception and may be changed.)

Wrong:

my_cool_little_thingy = "something"

End of current version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pbslib-0.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pbslib-0.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file pbslib-0.0.1.tar.gz.

File metadata

  • Download URL: pbslib-0.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pbslib-0.0.1.tar.gz
Algorithm Hash digest
SHA256 27df580ae88350f17ad20f1b27dd5eafde4cde7e695f7aafb89415fa14432989
MD5 39f83462b735bc411efb78932f7baaa5
BLAKE2b-256 07bfbafb477dbbebdaf1b66cd9960a97bd9ead978a2a413c1c3c5f07899a9a08

See more details on using hashes here.

File details

Details for the file pbslib-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pbslib-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for pbslib-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12ba2eede7268319aaaf3070cffbd28e4280ee18b50fc5cbb005d8de7721563f
MD5 453e92aac8c301d8a3ca4b4e1fa9b8c6
BLAKE2b-256 9fd5c2a148888dec4d9c842fce7752566e26ff182d80f5e3b11bb48c905c8e97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page