Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hardcoded copyright year #3616

Merged
merged 4 commits into from
Feb 16, 2018

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Feb 15, 2018

No description provided.

@@ -10,7 +14,7 @@ source_parsers = {
}
master_doc = 'index'
project = u'{{ project.name }}'
copyright = u'2016'
copyright = datetime.now().year
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this expected to be a string somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like yes!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that all the tests pass but this simple change breaks all the builds p:

docs/conf.py Outdated
@@ -33,7 +36,9 @@

master_doc = 'index'
project = u'Read the Docs'
copyright = u'2010-2017, Read the Docs, Inc & contributors'
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
datetime.now().year
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using python datetime, use django timezone. It have timezone aware time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't depends on Django for building the RTD documentation. So, you will probably need another way to achieve this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@humitos for the rtd docs django is imported, for the generated conf.py for empty projects it's not, and probably it's ok using plain datetime there, since is just a year and only used for projects without a conf.py file.

Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at the timezone comment raised by @safwanrahman. Anyway, this PR is too much better that we already have.

docs/conf.py Outdated
@@ -33,7 +36,9 @@

master_doc = 'index'
project = u'Read the Docs'
copyright = u'2010-2017, Read the Docs, Inc & contributors'
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
datetime.now().year
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't depends on Django for building the RTD documentation. So, you will probably need another way to achieve this.

@stsewd
Copy link
Member Author

stsewd commented Feb 15, 2018

@humitos I update to use django timezone on the rtd docs, for the other template see #3616 (comment)

@@ -10,7 +14,7 @@ source_parsers = {
}
master_doc = 'index'
project = u'{{ project.name }}'
copyright = u'2016'
copyright = str(datetime.now().year)
Copy link
Member Author

@stsewd stsewd Feb 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, should be better to generate this on template parse time (using {{ some_year }}) rather than build time?

@ericholscher
Copy link
Member

I don't think the timezone matters for this simple PR. Let's not overengineer solutions, and try to ship things that are simple.

@ericholscher ericholscher merged commit a79534b into readthedocs:master Feb 16, 2018
@stsewd stsewd deleted the remove-hard-coded-year branch February 16, 2018 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants